Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/277.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 无法加载文件或程序集';Microsoft.CodeDom.Providers.DotNetCompilerPlatform。(来自HRESULT的异常:0x8013100)_C#_Model View Controller - Fatal编程技术网

C# 无法加载文件或程序集';Microsoft.CodeDom.Providers.DotNetCompilerPlatform。(来自HRESULT的异常:0x8013100)

C# 无法加载文件或程序集';Microsoft.CodeDom.Providers.DotNetCompilerPlatform。(来自HRESULT的异常:0x8013100),c#,model-view-controller,C#,Model View Controller,无法加载文件或程序集“Microsoft.CodeDom.Providers.DotNetCompilerPlatform,版本=1.0.0.0,区域性=中性,PublicKeyToken=31bf3856ad364e35”或其依赖项之一。定位的程序集清单定义与程序集引用不匹配。(来自HRESULT的异常:0x8013100) 我安装了以下用于WebApi身份验证的dll文件 Microsoft.Owin Microsoft.Owin.Host.SystemWeb Microsoft.Owin.

无法加载文件或程序集“Microsoft.CodeDom.Providers.DotNetCompilerPlatform,版本=1.0.0.0,区域性=中性,PublicKeyToken=31bf3856ad364e35”或其依赖项之一。定位的程序集清单定义与程序集引用不匹配。(来自HRESULT的异常:0x8013100)

我安装了以下用于WebApi身份验证的dll文件

Microsoft.Owin
Microsoft.Owin.Host.SystemWeb
Microsoft.Owin.Security.OAuth
Microsoft.Owin.Security
Microsoft.AspNet.Identity.Owin
此错误仅在托管环境中发生。
它将在本地托管机器[哪个开发机器]和代码中运行良好。

从托管网站的web配置中删除此代码

<compilers>
      <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701" />
      <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+" />
    </compilers>

这是我发布的网站的web配置

<?xml version="1.0" encoding="utf-8"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=301880
  -->
<configuration>
  <appSettings>
    <add key="webpages:Version" value="3.0.0.0" />
    <add key="webpages:Enabled" value="false" />
    <add key="ClientValidationEnabled" value="true" />
    <add key="UnobtrusiveJavaScriptEnabled" value="true" />
  </appSettings>


  <system.web>


    <compilation debug="true" targetFramework="4.5.2" />
    <httpRuntime targetFramework="4.5.2" maxRequestLength="1048576000"/>


  </system.web>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>


谢谢您的回答。现在我无法加载文件或程序集“Newtonsoft.Json,Version=6.0.0.0,Culture=neutral,PublicKeyToken=30ad4fe6b2a6eed”或其依赖项之一。定位的程序集清单定义与程序集引用不匹配。(来自HRESULT:0x8013100的异常)此错误答案已更新,添加了我的整个web配置,与您的相比,干杯!请您投票,或者描述一下您收到的进一步错误。如果有帮助,请标记为答案