Modifying project files in Visual Studio during pre-build

So it turns out that Visual Studio uses the application’s cache if a file is open at build time instead of loading the file off disk…ok so this is good, when you want to save memory and speed up the build process. BUT when you are editing a source file that is being created/modified during the Pre-Build step, then you are in a little bit of trouble.

After some digging, it turns out that it’s a known process and in visual studio 2008 (at least) an additional option is not going to be added. So how do we get around this?

Add the highlighted line to your projects build settings and it will force the applications to load the file from disk and not from its cache. It didn’t take me too long to find this information out, but it’s good to know if you get in a position that you need to do this.


<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'PCRelease|AnyCPU' ">


Original Microsoft Feedback Post