Roslyn *.rsp *.config files missing after MSBuild, causes compilation error in IIS

0

When building a new WebApi2 project on my local machine (via Visual Studio 2017 or MSBuild), I can run the application via IISExpress or IIS just fine.

However, when I build it from our team's build server (via MSBuild), the following specific files are missing in the output directory for roslyn:

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

I've verified that MSBuild is being called with the same parameters on my machine and the build server. I've also verified that both have the same version of MSBuild, and both have .NET 4.7 installed (the version I'm targetting).

Without the above config/rsp files present in the roslyn directory, I get the following errors from IIS (truncated repeats):

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?)

What am I doing wrong here?

asp.net
msbuild
roslyn
asked on Stack Overflow Jun 5, 2019 by UnknownBeef

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0