2
votes

I have just upgraded my DotNetOpenAuth version from 3.4.7.11121 to 4.0.0.12079-RC1 to get support for OAuth2. The problem is that after the upgrade my OpenID-requests not longer works. The last row below generates a FileNotFoundException (Message=Could not load file or assembly 'System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies.)

OpenIdRelyingParty openid = new OpenIdRelyingParty()
var request = openid.CreateRequest(requestedIdentifier, Realm.AutoDetect, returnUrl);
return request.RedirectingResponse.AsActionResult();

I can't really understand why it looks for that file. I use the DotNetOpenAuth library in a MVC3 application, and thus the 3.0-version of the System.Web.Mvc-file exists in the project.

Anyone that has any ideas what I can do to make it work?


Updated: The stable 4.0.0.12084 version was released a few hours after I posted this question. Have installed that instead of the RC, but it doesn't make any difference. I tried to install MVC ver 1.0 in order to get the required dll. After the installation no exception is thrown, but instead a white page containing the text "DotNetOpenAuth.Messaging.OutgoingWebResponseActionResult" is displayed instead of the redirect to the OpenID-service provider. I don't understand this..

//Per Andersson

1
Remember to mark the below answer as the accepted answer if it helped you.Mathias Lykkegaard Lorenzen

1 Answers

2
votes

Yeay, I found a solution. Just add a few lines in web.config

<runtime>
    <legacyHMACWarning enabled="0" />

    <!-- When targeting ASP.NET MVC 3, this assemblyBinding makes MVC 1 and 2 references relink
         to MVC 3 so libraries such as DotNetOpenAuth that compile against MVC 1 will work with it. -->
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
        <dependentAssembly>
            <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
            <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
        </dependentAssembly>
    </assemblyBinding>
</runtime>