Could not load file or assembly 'DotNetOpenAuth.Core

I've seen this happen when deploying an MVC application as bin deploy. When you right-click on a project and select Add deployable dependencies VS will add the references to Oauth if you check the box next to ASP .NET Webpages with Razor syntax.

To fix this, delete the _bin_deployableAssemblies folder, and your application's bin folder and then clean and rebuild your application and it will work again.


If you don't want use OAuth, remove references: both the WebPages OAuth DLL (I think it's Microsoft.Web.WebPages.OAuth.dll 1) and DotNetOpenAuth DLLs.


1: You can find the filename in Calling assembly. So, removing all calling assembly of DotNetOpenAuth.Core should work for you. This approach should work for other unused missing references.


I had similar problem. It was really strange as the project was running OK a day before.

Removing obj and bin folders from the project folder, cleaning the solution and rebuilding it worked.

Hope that helps.