Roslyn compiler version used for projects missing Microsoft.Net.Compilers

跟風遠走 提交于 2019-12-20 03:53:49

问题


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.

source: Roslyn NuGet packages

As 3 other projects do not have Microsoft.Net.Compilers NuGet package installed, what Roslyn compiler and C# version do they use?

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.


回答1:


The Microsoft.Net.Compilers package overrides (by setting properties in your project file) the default version of Roslyn included with MSBuild / Visual Studio.

Regular class libraries that don't reference it are compiled using the Roslyn build included with your version of Visual Studio & MSBuild.



来源:https://stackoverflow.com/questions/45080482/roslyn-compiler-version-used-for-projects-missing-microsoft-net-compilers

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!