HTTP错误500.50 - URL重写模块错误 - Microsoft.Web.Iis.Rewrite.Providers

时间:2015-09-08 16:40:49

标签: iis

我的电脑上出现此错误。尝试从IIS Express上的Visual Studio 2015运行应用程序。但同样是在本地IIS上。

HTTP Error 500.50 - URL Rewrite Module Error.
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Web.Iis.Rewrite.Providers, Version=7.1.761.0, Culture=neutral, PublicKeyToken=0545b0627da60a5f' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.Web.Iis.Rewrite.Providers, Version=7.1.761.0, Culture=neutral, PublicKeyToken=0545b0627da60a5f' at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type) 
at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName) at System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark) 
at System.Type.GetType(String typeName, Boolean throwOnError) at Microsoft.Web.Iis.Rewrite.RewriteProviderManager.RegisterProvider(String providerName, String providerType, String[] settings, IRewriteContextInterop rewriteContext) WRN: Assembly binding logging is turned OFF. 
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There is some performance penalty associated with assembly bind failure logging. 
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

我安装了URL Rewrite扩展程序,我不认为我的web.config中存在错误,因为在我的笔记本上它可以正常工作。 Windows 10,IIS 7,Visual Studio 2015。

这是我的web.config

的一部分
<?xml version="1.0"?>
<configuration>
  <configSections>    
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
</configSections>  
<connectionStrings>
<add name="Cnn" connectionString="MYCONNSTRING" />    
</connectionStrings>
<system.web>
  <compilation debug="true" targetFramework="4.5.1"/>
  <httpRuntime requestValidationMode="2.0"/>
  <customErrors mode="Off" />
</system.web>
<system.webServer>
  <httpErrors existingResponse="Auto" />    
  <caching/>
  <rewrite>
    <providers>
      <provider name="DB" type="DbProvider, Microsoft.Web.Iis.Rewrite.Providers, Version=7.1.761.0, Culture=neutral, PublicKeyToken=0545b0627da60a5f">
      <settings>
        <add key="ConnectionString" value="MYCONNSTRING" />                        
        <add key="StoredProcedure" value="prRewriteGet"/>
        <add key="CacheMinutesInterval" value="0"/>
      </settings>
    </provider>
    <provider name="DBRedirect" type="DbProvider, Microsoft.Web.Iis.Rewrite.Providers, Version=7.1.761.0, Culture=neutral, PublicKeyToken=0545b0627da60a5f">
      <settings>
        <add key="ConnectionString" value="MYCONNSTRING" />                        
        <add key="StoredProcedure" value="prRewriteRedirectGet"/>
        <add key="CacheMinutesInterval" value="0"/>
      </settings>
    </provider>
    <provider name="DBRedirectManual" type="DbProvider, Microsoft.Web.Iis.Rewrite.Providers, Version=7.1.761.0, Culture=neutral, PublicKeyToken=0545b0627da60a5f">
      <settings>
        <add key="ConnectionString" value="MYCONNSTRING" />                        
        <add key="StoredProcedure" value="prRewriteRedirectManualGet"/>
        <add key="CacheMinutesInterval" value="0"/>
      </settings>
    </provider>
  </providers>
  <outboundRules>
    <preConditions>
      <preCondition name="ResponseIsHtml1">
        <add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html"/>
      </preCondition>
    </preConditions>
  </outboundRules>
  <rules>
    <clear/>        
    <rule name="HtmlSiteMap" enabled="true" stopProcessing="true">
      <match url="^sitemap[\/]{0,1}$"/>
      <conditions logicalGrouping="MatchAll" trackAllCaptures="false"/>
      <action type="Rewrite" url="Default.aspx" appendQueryString="true"/>
    </rule>
    .
    .
    .
    .
    .
    <rule name="DbRedirectManual" enabled="true" stopProcessing="false">
      <match url="(.*)"/>
      <conditions>
        <add input="{URL}" pattern="^(.*)(\.jpg|\.png|\.gif|\.js|\.css|\.aspx|\.ashx|\.pdf)$" negate="true"/>
        <add input="{DBRedirectManual:{R:1}}" pattern="(.+)"/>
      </conditions>
      <action type="Redirect" url="{C:1}"/>
    </rule>
    <rule name="DbRedirect" enabled="true" stopProcessing="false">
      <match url="(.*)" negate="false"/>
      <conditions>
        <add input="{URL}" pattern="^(.*)(\.jpg|\.png|\.gif|\.js|\.css|\.aspx|\.ashx|\.pdf)$" negate="true"/>
        <add input="{URL}" pattern="^(.*)\/$" negate="true"/>
        <add input="{DBRedirect:{R:1}}" pattern="(.+)"/>
      </conditions>
      <action type="Redirect" url="{C:1}"/>
    </rule>
    <rule name="DbRewrite" enabled="true" stopProcessing="true">
      <match url="(.*)" negate="false"/>
      <conditions>
        <add input="{URL}" pattern="^(.*)(\.jpg|\.png|\.gif|\.js|\.css|\.aspx|\.ashx|\.pdf)$" negate="true"/>
        <add input="{DB:{R:1}}" pattern="(.+)"/>
      </conditions>
      <action type="Rewrite" url="{C:1}"/>
    </rule>
  </rules>
</rewrite>

   

更新

我发现我的计算机上没有安装程序集。但另一方面则是。我如何下载/复制汇编?

更新

问题解决了这个How to extract an assembly from the GAC?从其他计算机复​​制程序集并重新启动。

0 个答案:

没有答案