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

11,272

Solution 1

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

Solution 2

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.

Solution 3

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.

Solution 4

Maybe VS 2015 does not affect the compiler used by VS 2013, but it definitely affects Roslyn (if you install VS 2015 your old, pre-VS2015 Roslyn code could stop working). For me it introduced problems with compiling anonymous types in ConfigR scripts.

Share:
11,272
Colonel Panic
Author by

Colonel Panic

If you really want to understand something, the best way is to try and explain it to someone else. That forces you to sort it out in your mind. And the more slow and dim-witted your pupil, the more you have to break things down into more and more simple ideas. And that's really the essence of programming. By the time you've sorted out a complicated idea into little steps that even a stupid machine can deal with, you've learned something about it yourself. —Douglas Adams

Updated on June 07, 2022

Comments

  • Colonel Panic
    Colonel Panic almost 2 years

    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?

    • user1703401
      user1703401 over 9 years
      Expecting the float type to have more than 7 significant digits is always a bug in your code, not the compiler. The random noise digit values beyond the 7th digit are affected by the jitter that is used, which did change.
    • Daniel Mann
      Daniel Mann over 9 years
      Don't install VS2015 on a production machine. It's an unsupported Preview.
    • spender
      spender over 9 years
      Heartily agree with @DanielMann. I wouldn't be attempting to fix this until VS2015 is a little more mature.
    • Crono
      Crono over 9 years
      How come there's a closing vote based on this thread being "primarily opinion based"?!? O.o
    • aquinas
      aquinas over 9 years
      I have 2015 and 2013 installed. As far as I know 2015 doesn't change anything for a 2013 install.
    • Colonel Panic
      Colonel Panic over 9 years
      Again, I'm not trying to 'fix' anything, I asked for an explanation of how Visual Studio works so to understand what will happen—if anything—when Visual Studio 2015 is released. At the moment, all our developer and test machines give identical results (the numbers are doubles). This is nice (while it lasts). Certainly differences could be managed with tolerances—as I suggested in the question!
  • Mark A. Donohoe
    Mark A. Donohoe over 8 years
    Are you sure you didn't upgrade the solution to 2015, or add 2015-only features to your projects? We're using 2010, 2013 and 2015 to open the same solution without any problems. We just make sure to not do anything that would force 2015 (or 2013)-only behavior.
  • Adam Seabridge
    Adam Seabridge over 8 years
    So it sounds like there is risk involved in running these side-by-side then if this upgrades the .Net runtime to 4.5.3. Are there any other known issues?