Why folders keep reappearing in my Visual Studio 2015 (WebForms) project?

March 03, 2017


If you have in your project files you moved to different location or removed but your .csproj still points to lets say : removedFolder/removedSubfolder/removedFile.ts then it might happen VS will recreate folders where you point (in this case removedFolder/removedSubfolder). What triggers this I wasn’t able to isolate and verify reliably (VS builds? open solution? some timer?).

My VS 2015 version to compare with yours :

Microsoft Visual Studio Enterprise 2015 Version 14.0.25431.01 Update 3 Microsoft .NET Framework Version 4.6.01586

I have quite some plugins installed, so maybe some plugin is causing this. I can dump list of all my plugins, if needed. Just mail me.

my setup and how I found out

This happened to me on project I work on and was quite difficult one to troubleshoot. Project is a bigger WebForms solution with some TypeScript files (among other stuff). We reordered some folders and forgot to save changes to .csproj. Since files we moved are TypeScript files and switched from built in TypeScript tooling build to npm builds, no build time error occurred. Folders kept reappearing and it was difficult to find some pattern what caused it. npm TypeScript builds? Running tape + karma tests? Some other tools? SVN even? No clue. But after I excluded missing files, folders didn’t appeared anymore. So I made a test solution like this,

VS with missing files

and boom, folders re appeared 🙂

Hope this helps.

Profile picture

Written by Dušan Roštár - the "mr edge case" guy
my twitter : rostacik, my linkedin : rostar, drop me an email : here