Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Would installing Visual Studio 2015 change the compiler used by VS 2013?

What C# compiler does Visual Studio 2013 use? If I were to install Visual Studio 2015 with its new Roslyn compiler, would that affect my Visual Studio 2013 installation?

I ask because we have some tests that are known to fail when our code is built with Visual Studio 2015. Some numbers differ at the eight significant figure. The solution when Visual Studio 2015 is released will probably be to increase the tolerances on the tests, but I'd like to understand how Visual Studio decides which compiler to use.

Can Visual Studio 2013 be explicitly set to use the old compiler? Or an msbuild script?

like image 447
Colonel Panic Avatar asked Nov 17 '14 15:11

Colonel Panic


3 Answers

What C# compiler does Visual Studio 2013 use? If I were to install Visual Studio 2015 with its new Roslyn compiler, would that affect my Visual Studio 2013 installation?

Installing Visual Studio 2015 Preview will not affect your Visual Studio 2013 installation, and the old C# and VB compilers that live in .NET Framework installation folder within the Windows directory are not replaced. Instead, Visual Studio 2015 Preview uses and includes a preview of the next version of the Microsoft Build Tools, MSBuild 14.0, that is installed in the 32-bit Program Files folder under \MSBuild\14.0 and contains the new Roslyn compilers and code analysis libraries.

For C++, nothing substantial has changed, and as the compilers live in the \VC\bin subfolder of the particular Visual Studio installation, they will not affect each other.

Can Visual Studio 2013 be explicitly set to use the old compiler? Or an msbuild script?

It's not necessary since Visual Studio 2013 can only use the old compilers, unless you installed and enabled the Roslyn CTP extension which has become obsolete by now.

like image 132
Florian S. Avatar answered Oct 17 '22 00:10

Florian S.


No. Installing Visual Studio 2015 doesn't change the compiler used by VS 2013. At the command line, you can choose between by running the corresponding msbuild.exe

The test failures were due to .NET Framework 4.6 , rather than a change in compiler.

Fixed the problem by setting the 'use legacy JIT' environment COMPLUS_useLegacyJit variable per https://github.com/Microsoft/dotnet/blob/master/docs/testing-with-ryujit.md

like image 22
Colonel Panic Avatar answered Oct 16 '22 23:10

Colonel Panic


Installing VS2015 will replace the .NET Runtime and update it to 4.5.3 - I don't know whether the JIT compiler is replaced, but it is possible.

In this case you could observe differing test results regardless of which C# compiler was used.

Anyways, installing 4.5.3 runtime is a major change to the machine and can't live side-by-side with non-preview runtimes so I'd not recommend it on a production machine. For example the Debugger API from Microsoft, CLRMD (Microsoft.Diagnostics.Runtime nuget package) no longer can connect to a 4.5.3 runtime - it's been reported here for example.

I would assume there are more breaking changes to be discovered.

like image 42
Zarat Avatar answered Oct 17 '22 01:10

Zarat