Roslyn编译器版本用于缺少Microsoft.Net.Compilers的项目 [英] Roslyn compiler version used for projects missing Microsoft.Net.Compilers
问题描述
解决方案包含2个dll库,1个控制台应用程序和1个Web应用程序。只有最后一个项目(网络项目)使用 Microsoft.Net.Compilers
NuGet程序包。软件包现在已更新到版本2.3.0,这意味着C#7.1和VB 15.3。
Solution consists of 2 dll libraries, 1 console app and 1 web app. Only the last project, the web one, uses Microsoft.Net.Compilers
NuGet package. Package has been updated to version 2.3.0 now, what means C# 7.1 and VB 15.3.
与其他3个项目一样没有安装Microsoft.Net.Compilers NuGet软件包,它们使用什么Roslyn编译器和C#版本?
As 3 other projects do not have Microsoft.Net.Compilers NuGet package installed, what Roslyn compiler and C# version do they use?
我在.NET Framework 4.7中使用VS.Net 2017 15.2,所以我猜应该是C#7.0,但仍然应该在其中安装2.2版的Microsoft.Net.Compilers,但不是。
I use VS.Net 2017 15.2 with .NET Framework 4.7, so I would guess it shall C#7.0, but still Microsoft.Net.Compilers in version 2.2 should be installed there, but is not.
推荐答案
Microsoft.Net.Compilers
包(通过在项目文件中设置属性)覆盖MSBuild / Visual Studio中包含的默认Roslyn版本。
The Microsoft.Net.Compilers
package overrides (by setting properties in your project file) the default version of Roslyn included with MSBuild / Visual Studio.
不引用它的常规类库是使用您的Visual Studio&版本中包含的Roslyn构建进行编译的。 MSBuild。
Regular class libraries that don't reference it are compiled using the Roslyn build included with your version of Visual Studio & MSBuild.
这篇关于Roslyn编译器版本用于缺少Microsoft.Net.Compilers的项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!