MSBuild之后缺少Roslyn * .rsp * .config文件,导致IIS中的编译错误

时间:2019-06-05 00:47:46

标签: asp.net msbuild roslyn

在本地计算机上(通过Visual Studio 2017或MSBuild)构建新的WebApi2项目时,我可以通过IISExpress或IIS运行应用程序。

但是,当我从团队的构建服务器(通过MSBuild)进行构建时,roslyn的输出目录中缺少以下特定文件:

Name
----
csc.exe.config
csc.rsp
csi.exe.config
csi.rsp
vbc.exe.config
vbc.rsp
VBCSCompiler.exe.config

我已验证在我的计算机和构建服务器上使用相同的参数调用了MSBuild。我还验证了它们都具有相同版本的MSBuild,并且都已安装.NET 4.7(我定位的版本)。

在roslyn目录中不存在上述config / rsp文件的情况下,我从IIS(截断的重复项)中收到以下错误:

error CS0009: Metadata file 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Runtime\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.dll' could not be opened -- Could not load file or assembly 'System.Collections.Immutable, Version=1.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\mytestapp\94741207\f208094f\App_global.asax.lejfnh-p.1.cs(13,12): error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?)
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\mytestapp\94741207\f208094f\App_global.asax.lejfnh-p.1.cs(12,51): error CS0103: The name 'System' does not exist in the current context
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\mytestapp\94741207\f208094f\App_global.asax.lejfnh-p.1.cs(13,63): error CS0518: Predefined type 'System.String' is not defined or imported
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\web.config(333,11): error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?)
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\mytestapp\94741207\f208094f\App_global.asax.lejfnh-p.0.cs(134,40): error CS0400: The type or namespace name 'mytestapp' could not be found 
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\mytestapp\94741207\f208094f\App_global.asax.lejfnh-p.1.cs(27,9): error CS0518: Predefined type 'System.Void' is not defined or imported
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\mytestapp\94741207\f208094f\App_global.asax.lejfnh-p.0.cs(136,24): error CS0518: Predefined type 'System.Boolean' is not defined or imported
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\mytestapp\94741207\f208094f\App_global.asax.lejfnh-p.0.cs(138,10): error CS0518: Predefined type 'System.Object' is not defined or imported
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\mytestapp\94741207\f208094f\App_global.asax.lejfnh-p.0.cs(138,10): error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?)

我在这里做什么错了?

0 个答案:

没有答案