3

I have this error on my computer. Trying run application from Visual Studio 2015 on IIS Express. But the same is on Local 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].

I have URL Rewrite extension installed and I don't think, that there is an error in my web.config, because on my notebook it works. Both Windows 10, IIS 7, Visual Studio 2015.

Here is part of my 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>

UPDATE

I found that the assembly is not installed on my computer. But on other one it is. How I can download/copy assembly?

UPDATE

Problem solved with this How to extract an assembly from the GAC? copying the assembly from other computer and restart.

Community
  • 1
  • 1
t00thy
  • 501
  • 5
  • 16

0 Answers0