Search code examples
c#performancecompiler-constructiontempdir

Change C# compile directory (Class Library & WPF; not ASP.NET)?


I'm running a Ramdisk in Windows 7. I've modified some web.config files to noticeably improve the compilation times of my ASP.NET solutions.

I've got a solution with about 40 WPF and Class Library projects, and it hasn't improved when I launch Visual Studio in an environment whose TEMP/TMP are pointed to the Ramdisk.

So, I'm thinking these TEMP/TMP environment variables don't influence the temp folders used when C# is compiling WPF and Class Library projects.

Can I change the temp folder C# uses when compiling WPF and Class Library projects?


Solution

  • C# doesn't use a temp folder when compiling normal projects.

    The ASP.Net runtime uses a temp folder to store the .cs files generated by ASPX pages before passing them to csc.exe, but normal projects are compiled in-place.

    You can move the intermediary obj folder by changing the BaseIntermediateOutputPath property in the .csproj file, which may help.