Question

I have recently found out that (merely) installing Visual Studio 2012 on my machine, causes Visual Studio 2010 to use the newer C# compiler. This happens even when setting the language version to 4 (http://ericlippert.com/2013/04/04/what-does-the-langversion-switch-do/).

I wanted to know if it were possible to force Visual Studio to use the old compiler anyway. I think it's not possible because it seems that the compiler is installed in the framework folder which is the same for .NET 4 and .NET 4.5, but I was wondering if someone managed to do it anyway somehow.

Was it helpful?

Solution 2

As I said in my original question and as some commented, it indeed seems this would be impossible. The new compiler is installed in the same place as the old compiler. One would need to have a clean build environment with the exact compiler needed.

OTHER TIPS

You can use the command line compiler see here, and run your code on the old compiler in post build actions

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top