Failed to load file or assembly "DotNetOpenAuth.Core

I get the following error when running asp net mvc 4 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 

This is an error log.

 Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll Running under executable C:\Windows\SysWOW64\inetsrv\w3wp.exe --- A detailed error log follows. === Pre-bind state information === LOG: User = notebook\Guilherme LOG: DisplayName = DotNetOpenAuth.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=2780ccd10d57b246 (Fully-specified) LOG: Appbase = file:///C:/Users/Guilherme/Documents/Visual Studio 2012/Projects/Gedi/Gedi/ LOG: Initial PrivatePath = C:\Users\Guilherme\Documents\Visual Studio 2012\Projects\Gedi\Gedi\bin Calling assembly : Microsoft.Web.WebPages.OAuth, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35. === LOG: This bind starts in default load context. LOG: Using application configuration file: C:\Users\Guilherme\Documents\Visual Studio 2012\Projects\Gedi\Gedi\web.config LOG: Using host configuration file: C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet.config LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config. LOG: Post-policy reference: DotNetOpenAuth.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=2780ccd10d57b246 LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/2635bb56/154c3fbb/DotNetOpenAuth.Core.DLL. LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/2635bb56/154c3fbb/DotNetOpenAuth.Core/DotNetOpenAuth.Core.DLL. LOG: Attempting download of new URL file:///C:/Users/Guilherme/Documents/Visual Studio 2012/Projects/Gedi/Gedi/bin/DotNetOpenAuth.Core.DLL. LOG: Attempting download of new URL file:///C:/Users/Guilherme/Documents/Visual Studio 2012/Projects/Gedi/Gedi/bin/DotNetOpenAuth.Core/DotNetOpenAuth.Core.DLL. LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/2635bb56/154c3fbb/DotNetOpenAuth.Core.EXE. LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/2635bb56/154c3fbb/DotNetOpenAuth.Core/DotNetOpenAuth.Core.EXE. LOG: Attempting download of new URL file:///C:/Users/Guilherme/Documents/Visual Studio 2012/Projects/Gedi/Gedi/bin/DotNetOpenAuth.Core.EXE. LOG: Attempting download of new URL file:///C:/Users/Guilherme/Documents/Visual Studio 2012/Projects/Gedi/Gedi/bin/DotNetOpenAuth.Core/DotNetOpenAuth.Core.EXE. 

I removed all links from DotNetOpenAuth using the package manager. I also checked my own links for every Auth assembly I had in my project, and it doesn't exist.

This is my package.config

 <packages> <package id="AutoMapper" version="2.2.0" targetFramework="net45" /> <package id="EntityFramework" version="5.0.0" targetFramework="net45" /> <package id="jQuery" version="1.7.1.1" targetFramework="net45" /> <package id="jQuery.UI.Combined" version="1.8.20.1" targetFramework="net45" /> <package id="jQuery.Validation" version="1.9.0.1" targetFramework="net45" /> <package id="knockoutjs" version="2.1.0" targetFramework="net45" /> <package id="Microsoft.AspNet.Mvc" version="4.0.20710.0" targetFramework="net45" /> <package id="Microsoft.AspNet.Razor" version="2.0.20710.0" targetFramework="net45" /> <package id="Microsoft.AspNet.Web.Optimization" version="1.0.0" targetFramework="net45" /> <package id="Microsoft.AspNet.WebApi" version="4.0.20710.0" targetFramework="net45" /> <package id="Microsoft.AspNet.WebApi.Client" version="4.0.20710.0" targetFramework="net45" /> <package id="Microsoft.AspNet.WebApi.Core" version="4.0.20710.0" targetFramework="net45" /> <package id="Microsoft.AspNet.WebApi.WebHost" version="4.0.20710.0" targetFramework="net45" /> <package id="Microsoft.AspNet.WebPages" version="2.0.20710.0" targetFramework="net45" /> <package id="Microsoft.AspNet.WebPages.Data" version="2.0.20710.0" targetFramework="net45" /> <package id="Microsoft.AspNet.WebPages.WebData" version="2.0.20710.0" targetFramework="net45" /> <package id="Microsoft.jQuery.Unobtrusive.Ajax" version="2.0.20710.0" targetFramework="net45" /> <package id="Microsoft.jQuery.Unobtrusive.Validation" version="2.0.20710.0" targetFramework="net45" /> <package id="Microsoft.Net.Http" version="2.0.20710.0" targetFramework="net45" /> <package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" /> <package id="Modernizr" version="2.5.3" targetFramework="net45" /> <package id="Newtonsoft.Json" version="4.5.11" targetFramework="net45" /> <package id="Repository" version="1.0.2.12" targetFramework="net45" /> <package id="RestSharp" version="103.4" targetFramework="net45" /> <package id="WebGrease" version="1.1.0" targetFramework="net45" /> </packages> 

thank

+82
c # asp.net-mvc asp.net-mvc-4
Dec 18 '12 at 22:37
source share
19 answers

If you do not want to use OAuth, remove the links: both the WebPages OAuth DLL (I think it is Microsoft.Web.WebPages.OAuth.dll 1 ) and the DotNetOpenAuth DLL.




1 : the file name can be found in the Calling assembly . Thus, removing all Calling assembly of DotNetOpenAuth.Core should work for you. This approach should work for other unused missing links.

+82
Dec 19
source share

I had a similar problem. It was really strange, because the project worked fine the day before.

Removing obj and bin files from the project folder, cleaning the solution and restoring it.

Hope this helps.

+75
Feb 08 '13 at
source share

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

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

+22
04 Feb '13 at 18:02
source share

In my case, the MVC4 application worked fine in the VS2012 debugger, but I got the message "Failed to load the file or assembly" DotNetOpenAuth.Core "when publishing the application on the server.

Checking the "Delete all existing files before publishing" checkbox on the "Settings" tab in the "Publish to the Internet" window solved the problem.

File System Publishing Settings

+16
Apr 18 '13 at 13:19
source share

I solved the problem by installing the package using Nuget

 Install-Package Microsoft.AspNet.WebPages.OAuth 
+11
Jul 11 '13 at 9:20
source share

By installing the following two packages, I solved this problem on VS2012 Professional Update 4 RC:

  • Open the package manager console from the menu:

    Tools | Library Package Management | Package Manager Console

  • DotNetOpenAuth.AspNet installation package

  • Microsoft.AspNet.WebHelpers installation package

Hope this helps you!

+3
Nov 08 '13 at 16:22
source share

Just select "Delete additional files at destination" in the publication settings. It works for me

+3
Jul 09 '14 at 18:49
source share

Try searching for a global solution (ctrl + shift + f if you have not changed it) for the value "2780ccd10d57b246". I assume you will find it in your web.config.

+2
Dec 18 '12 at 22:59
source share

Another solution is to have a build dependency as follows:

 <dependentAssembly> <assemblyIdentity name="DotNetOpenAuth.AspNet" publicKeyToken="2780ccd10d57b246" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-4.3.0.0" newVersion="4.3.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="DotNetOpenAuth.Core" publicKeyToken="2780ccd10d57b246" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-4.3.0.0" newVersion="4.3.0.0" /> </dependentAssembly> 
+1
Oct 14 '13 at 5:47 on
source share

I have no reputation for comment, but I can verify that I had this exact problem and Jack gave the right solution for me. I recently clicked on the Add Service link and it quit the program with the error message above.

Removing the _bin_deployableAssemblies folder and the folder of your application, and then cleaning and restoring your application made it work again.

+1
Jan 17 '14 at 14:19
source share

for me it worked as follows: using the package manager console, I removed the packages by following the following sequence of orders, and I installed it, it solved my problem.

Delete

 Uninstall-Package Microsoft.AspNet.WebPages.OAuth Uninstall-Package DotNetOpenAuth.AspNet Uninstall-Package DotNetOpenAuth.OpenId.RelyingParty Uninstall-Package DotNetOpenAuth.OpenId.Core Uninstall-Package DotNetOpenAuth.OAuth.Consumer Uninstall-Package DotNetOpenAuth.OAuth.Core Uninstall-Package DotNetOpenAuth.core 

Assembly. If you do not use the above packages, then this should solve the problem, to install the above again, if you need it, follow these steps.

Reinstall

 install-Package DotNetOpenAuth.AspNet install-Package Microsoft.AspNet.WebPages.OAuth install-Package DotNetOpenAuth.OpenId.RelyingParty install-Package DotNetOpenAuth.OpenId.Core install-Package DotNetOpenAuth.OAuth.Consumer install-Package DotNetOpenAuth.OAuth.Core install-Package DotNetOpenAuth.core 

Recommended:

  • go to the bin folder of the project, remove it
  • when you publish to IIS, delete the virtual directory and assign the IIS website again, as I ran into a cash issue issue on the server that was creating the problem ...
+1
May 04 '14 at 6:45
source share

In case this helps someone, I could not remove the DotNetOpenAuth components via Nuget, so I resolved this error by excluding them from the list of links directly and then reinstalling dotnetopenauth via nuget.

0
Oct 14 '13 at 17:51
source share

I also got this error, but with the ASP.NET MVC 5 project. I solved this by installing the DotNetOpenAuth.Mvc5 package and calling AsActionResultMvc5 () instead of AsActionResult ()

0
Apr 24 '14 at 9:03
source share

It helped me to add the following section to the csproj file:

 <PropertyGroup> <PostSharpHostConfigurationFile>web.config</PostSharpHostConfigurationFile> </PropertyGroup> 
0
Aug 08 '14 at 20:12
source share

I had the same problem. My published web.config did not have lines:

  <dependentAssembly> <assemblyIdentity name="DotNetOpenAuth.Core" publicKeyToken="2780ccd10d57b246" /> <bindingRedirect oldVersion="1.0.0.0-4.1.0.0" newVersion="4.1.0.0" /> </dependentAssembly> 

Just added and it worked.

0
Mar 03 '15 at 12:51
source share

Just delete the BIN folder from wwwroot and publish again.

0
06 oct. '15 at 13:31 on
source share

I was able to solve this at my end by uninstalling Microsoft.AspNet.Membership.OpenAuth

0
Mar 27 '16 at 7:14
source share

I encounter this problem when I work on updating all our libraries. this link helped me solve this problem. https://www.devexpress.com/Support/Center/Question/Details/Q554890/the-could-not-load-file-or-assembly-dotnetopenauth-core-version-4-0-0-0erer- message is .

I specifically added these binding redirects to my web.config file.

  <dependentAssembly> <assemblyIdentity name="DotNetOpenAuth.Core" publicKeyToken="2780CCD10D57B246" culture="neutral" /> <bindingRedirect oldVersion="1.0.0.0-4.1.0.0" newVersion="4.3.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="DotNetOpenAuth.AspNet" publicKeyToken="2780CCD10D57B246" culture="neutral" /> <bindingRedirect oldVersion="1.0.0.0-4.1.0.0" newVersion="4.3.0.0" /> </dependentAssembly> 
0
Jun 03 '19 at 16:47
source share

Remove all Microsoft.Web.WebPages.OAuth dependencies in all projects.

-2
Apr 17 '13 at 15:01
source share



All Articles