开发者

Why is Combres still looking for an older version of System.Web.Mvc?

I'm using Combres with my MVC 3 RC project and getting an an assembly binding error when I deploy it to my web server.

System.IO.FileLoadException

Could not load file or assembly 'System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

<%= Html.CombresLink("commonJs") %>

My development machine has the MVC 1 and 2 assemblies in the GAC, so it works fine there. The web server doesn't have any version of MVC in the GAC, and I'm bin-deploying the MVC 3 assembly. My project references version 3.0.0.0 of System.Web.Mvc, and I have the following section in my web.config:

<r开发者_如何学Pythonuntime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
        <dependentAssembly>
            <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
            <bindingRedirect oldVersion="1.0.0.0" newVersion="2.0.0.0" />
        </dependentAssembly>
        <dependentAssembly xmlns="">
            <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
            <bindingRedirect oldVersion="2.0.0.0" newVersion="3.0.0.0" />
        </dependentAssembly>
    </assemblyBinding>
</runtime>

I thought that this section would tell Combres to use version 3.0.0.0 instead. Why is my application failing to resolve the reference?


I don't think the binding redirect will chain - you have a reference to 1.0 somewhere, and your config tells it to load 2.0, which does not exist.

You need just one binding redirect with oldVersion set to "1.0.0.0-2.0.0.0"

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜