![](/img/trans.png)
[英]Is there a way to use Microsoft.CodeDom.Providers.DotNetCompilerPlatform without a nuget package?
[英]csc.exe compilation time degradation when “Microsoft.CodeDom.Providers.DotNetCompilerPlatform” package is used
我们的团队目前正在从C#5.0迁移到C#6.0语法,因此应使用Roslyn编译器而不是旧版编译器。
我们必须在复杂的解决方案编译过程中使用“ csc.exe”。 生成命令如下所示:
c:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc.exe -nologo -target:library -out:c:\repo\bin64\deb\common.dll @.\rspE0FF.tmp
该命令执行大约需要400ms
“ rspE0FF.tmp”内容看起来像这样(它包含更多* .cs文件,但是,没关系,这在任何文件集上都可以重现):
"c:\repo\shared\common\estimation\complexjob.cs"
"c:\repo\shared\common\stringdecorator.cs"
"c:\repo\shared\common\tplextensions.cs"
"/reference:mscorlib.dll" "/reference:System.dll" "/reference:System.Data.dll" "/reference:System.Xml.dll" "/reference:System.ServiceModel.Activation.dll" "/reference:System.IdentityModel.dll" "/reference:System.Data.Entity.dll"
当使用Roslyn编译器时,执行时间喊到〜4100ms。命令是相同的,只是从包文件夹中调用csc.exe:
c:\NewRepo\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\tools\RoslynLatest\csc.exe -nologo -target:library -out:c:\repo\bin64\deb\common.dll @.\rspE0FF.tmp
我们必须通过依次运行数百个csc.exe命令来构建解决方案。 总编译时间从2分钟增加到8分钟。
是否会导致性能下降?
关于如何进行调整的任何建议?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.