我可以毫无错误地构建ASP.NET MVC 5 Web应用程序项目,但是当我尝试发布或运行它时,出现以下错误:
Error Could not load file or assembly 'System.Runtime, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. GPS Web App C:\Users\Me\Source\Repos\My Solution\My Web App\obj\dev.example.com\AspnetCompileMerge\Source\web.config 115 IntelliSense
Web.config包含对System.Runtime的2个引用:
<compilation debug="false" targetFramework="4.6.1">
<assemblies>
<add assembly="System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</assemblies>
</compilation>
和
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Runtime" culture="neutral" publicKeyToken="b03f5f7f11d50a3a" />
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
</dependentAssembly>
</assemblyBinding>
我尝试卸载NuGet System.Runtime,然后重新安装。我可以看到正在创建引用,并且System.Runtime显示在/ bin中。我尝试安装System.Runtime 4.1.0甚至4.3.0。
如何解决此错误的原因?