views:

34

answers:

1

I have a csproj file which references a shared MSBuild script with an <Import> directive. I have noticed that when I change the shared script, I need to close and reopen Visual Studio before it notices the change - a build within Visual Studio notices changes to the csproj file but not the shared file.

This doesn't happen when I build the project with MSBuild from the command line. Is Visual Studio caching the imported script? If so, why? And how can I turn off this behaviour which makes authoring build scripts hard / impossible using Visual Studio?

Thanks!

A: 

Instead of closing and re-opening Visual Studio have you tried, unloading and reloading the project (.csproj) which imports the shared script? You can do this from the Solution Explorer in Visual Stduio by right clicking on the loaded project and selecting unload and then on the unloaded project and picking load.

Sayed Ibrahim Hashimi
Thanks Sayed! That wouldn't be much better though. Why do think VS does this? It's surprising and very inconvenient.
Pete Montgomery
To increase performance. In most cases imported files will not change.
Sayed Ibrahim Hashimi