Visual Studio 2013 and MSBuild Incremental Build Incompatibility

I am working on a project that has a fairly standard Visual Studio 2013 build chain. One of the projects within the solution is used exclusively to compile .hlsl files into .cso files, which are then loaded at runtime. When built inside the Visual Studio IDE, incremental builds behave as expected; if i edit color_ps.hlsl then only this shader gets compiled into the corresponding .cso file.

In the interest of speeding up the developer workflow, we have a system that automatically recompiles and then reloads shaders at runtime. Basically, if the application is running and the user is editing color_ps.hlsl, I launch MSBuild from the application to restore the project containing our shaders and then reload its corresponding .cso file. Incremental builds work as expected here.

This all works fantastic, the only problem is that it seems that there are some incompatibilities between the IDE and MSBuild. The first time you compile with MSBuild at runtime, all .hlsl files in the project will be rebuilt. Further rebuilds use incremental builds as expected.

Additionally, after exiting the application, attempting to create a shader project from Visual Studio ID also triggers a full rebuild. After rebuilding, use an incremental build as expected.

My suspicion why this is happening is that the IDE and MSBuild don't recognize that their outputs are already up to date. To clarify, the output assemblies compiled from the IDE and MSBuild are identical and therefore should be validated regardless of where the assembly is called from.

Does anyone know a way to prevent these unnecessary full rebuilds when switching between building from the IDE and calling MSBuild at runtime? Thank!

+3


source to share





All Articles