简体   繁体   English

安装Visual Studio 2015会更改VS 2013使用的编译器吗?

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

What C# compiler does Visual Studio 2013 use? Visual Studio 2013使用什么C#编译器? If I were to install Visual Studio 2015 with its new Roslyn compiler, would that affect my Visual Studio 2013 installation? 如果我使用新的Roslyn编译器安装Visual Studio 2015,会影响我的Visual Studio 2013安装吗?

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. 我问,因为当我们的代码使用Visual Studio 2015构建时,我们有一些已知失败的测试。有些数字在八位有效数字上有所不同。 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. Visual Studio 2015发布时的解决方案可能是增加测试的容差,但我想了解Visual Studio如何决定使用哪个编译器。

Can Visual Studio 2013 be explicitly set to use the old compiler? 可以将Visual Studio 2013显式设置为使用旧编译器吗? Or an msbuild script? 还是一个msbuild脚本?

What C# compiler does Visual Studio 2013 use? Visual Studio 2013使用什么C#编译器? If I were to install Visual Studio 2015 with its new Roslyn compiler, would that affect my Visual Studio 2013 installation? 如果我使用新的Roslyn编译器安装Visual Studio 2015,会影响我的Visual Studio 2013安装吗?

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. 安装Visual Studio 2015 Preview不会影响Visual Studio 2013的安装,并且不会替换Windows目录中的.NET Framework安装文件夹中的旧C#和VB编译器。 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. 相反,Visual Studio 2015 Preview使用并包含下一版本的Microsoft Build Tools MSBuild 14.0的预览版,该版本安装在\\ MSBuild \\ 14.0下的32位Program Files文件夹中,并包含新的Roslyn编译器和代码分析库。

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. 对于C ++,没有任何重大变化,并且由于编译器位于特定Visual Studio安装的\\ VC \\ bin子文件夹中,因此它们不会相互影响。

Can Visual Studio 2013 be explicitly set to use the old compiler? 可以将Visual Studio 2013显式设置为使用旧编译器吗? Or an msbuild script? 还是一个msbuild脚本?

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. 这是没有必要的,因为Visual Studio 2013只能使用旧的编译器,除非您安装并启用了Roslyn CTP扩展,现在它已经过时了。

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 否。安装Visual Studio 2015不会更改VS 2013使用的编译器。在命令行中,您可以通过运行相应的msbuild.exe来选择

The test failures were due to .NET Framework 4.6 , rather than a change in compiler. 测试失败是由.NET Framework 4.6引起的,而不是编译器的更改。

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 通过按https://github.com/Microsoft/dotnet/blob/master/docs/testing-with-ryujit.md设置'use legacy JIT'环境COMPLUS_useLegacyJit变量来解决此问题。

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. 安装VS2015将取代.NET运行时并将其更新为4.5.3 - 我不知道是否更换了JIT编译器,但它是可能的。

In this case you could observe differing test results regardless of which C# compiler was used. 在这种情况下,无论使用哪种C#编译器,您都可以观察到不同的测试结果。

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. 无论如何,安装4.5.3运行时对机器的一个重大改变,并且不能与非预览运行时并存,所以我不建议在生产机器上使用它。 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. 例如,来自Microsoft的调试器API,CLRMD(Microsoft.Diagnostics.Runtime nuget包)不再能够连接到4.5.3运行时 - 例如,它在此处报告

I would assume there are more breaking changes to be discovered. 我认为有更多的重大变化有待发现。

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). 也许VS 2015不会影响VS 2013使用的编译器,但它肯定会影响Roslyn(如果您安装VS 2015,那么您的旧VS2015之前的Roslyn代码可能会停止工作)。 For me it introduced problems with compiling anonymous types in ConfigR scripts. 对我来说,它引入了在ConfigR脚本中编译匿名类型的问题。

I faced the issue by installing VS Professional 2015 Release side by side VS professional 2012. My MVC 3 Project created in VS 2012/ .net 4.0 I am not able to open now. 我通过安装VS Professional 2015 Release并排VS专业2012来解决这个问题。我在VS 2012 / .net 4.0中创建的MVC 3项目我现在无法打开。 I am able to open it in VS 2015/ .Net 4.0 only. 我只能在VS 2015 / .Net 4.0中打开它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM