I\'ve written a C# preprocessor that I\'ve incorporated into my .csproj projects by invoking it using the BeforeBuild MSBuild target. This works OK except that when the prep
This isn't an optimal solution, but it's the best I've come up with so far.
As documented here http://social.msdn.microsoft.com/Forums/en-US/vsdebug/thread/6c042390-0782-4afe-94be-9746d75f5d34/ you can place
<UseHostCompilerIfAvailable>false</UseHostCompilerIfAvailable>
in the .csproj file, and that gets Visual Studio to use the "normal" C# compiler instead of the "internal" one that uses the cached files. This presumably reduces performance, but I haven't noticed it, or tried to measure it.
And, as documented here http://startbigthinksmall.wordpress.com/2009/03/16/visual-studio-tipp-auto-refresh-file-changes/ you can get Visual Studio to stop nagging you about the updated files, and simply reload them.
I would still prefer to find some way of telling Visual Studio to update its cached files and then invoke its internal compiler ...
I'm marking this as "the answer", but I'd still like to hear better possibilities, and if that happens I'll unmark this one.