I published my MVC 4 Razor application in IIS and I get this error when I browse the application.
"Could not load file or assembly 'DotNetOpenAuth.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=2780ccd10d57b246' or one of its dependencies. The system cannot find the file specified."
I’ve tried changing “false” to “true” in the Copy Local option from the MVC dll properties.
System.Web.Abstractions,
System.Web.Routing,
System.Web.MVC,
System.Web.Helpers,
System.Web.Razor
I’ve Uninstalled Nuget Packages related to DotNetOpenAuth.
I’ve used “Add Deployable Dependencies” choosing ASP.NET Web Pages with Razor syntax.
My Application is a typical MVC 4 project with 4 more Library Projects.
My IIS Configuration is the common. DefaultAppPool. Integrated Mode.
And When I Publish I choose FileSystem and the Target Location.
Hope somebody can help me as I’ve been dealing with this problem for some days.
EDIT
To Resolve this I had to delete the Microsoft.Web.WebPages.OnAuth dll generated in the Bin folder of the Published Files.
“DotNetOnAuth is an open source library that bring OpenID, OAuth, and ICard capabilities to the Microsoft .NET Framework.”
It seems that the library kept growing but .NET Framework is still referencing to the old 4.0.0.0 Version.
In my case deleting it solved the issue since I’m not using it.
But I don’t know what others should do if they are using the library. Maybe changing the referenced assembly version would solve it.
Glad you solved it.
I’ve seen this happen when deploying an MVC application as
bin deploy. and selectingASP .NET Webpages with Razor syntaxin theAdd deployable dependenciesdialog box. This causes VS to add the references to Oauth.Usually, deleting the generated deployable bin folder and the App’s bin folder, and then cleaning and rebuilding the solution will fix the problem.