Could not load file or assembly 'DotNetOpenAuth.AspNet'

I am getting below error whenever I run my project. This has been happening since the installation of DotNetOpenAuth.

Could not load file or assembly 'DotNetOpenAuth.AspNet' or one of its dependencies. The located assembly manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Description: An unhandled exception was thrown during the execution of the current web request. Review the stack trace for more information about the error and how it occurs in your code.

Exception Details: System.IO.FileLoadException: Could not load file or assembly 'DotNetOpenAuth.AspNet' or one of its dependencies. The located assembly manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Source error:

An unhandled exception was thrown during the execution of the current web request. Information about the origin and location of an exception can be identified using the exception stack trace below.

Load shedding assembly. The following information may be helpful in determining why the assembly "DotNetOpenAuth.AspNet" could not be loaded.

=== Pre-binding state information === LOG: DisplayName = DotNetOpenAuth.AspNet (Partial) WRN: Partial binding information was provided for the assembly: WRN: Assembly Name: DotNetOpenAuth.AspNet | Domain ID: 2 WRN: Partial linking occurs when only part of the display name of an assembly is provided. WRN: This can cause the binder to load the wrong assembly. WRN: It is recommended to provide a fully qualified text identifier for the assembly

I also get the warning below when building the project.

C: \ Program Files (x86) \ MSBuild \ 12.0 \ bin \ Microsoft.Common.CurrentVersion.targets (1697.5): MSB3277 warning: There were conflicts between different versions of the same dependent assembly that could not be resolved. These referential conflicts are listed in the build log when the log details are specified.

There is absolutely no information about what is going wrong here. Can someone help me debug the question of what the problem is. I've been trying to fix this for the last 2 days, but no luck.

Edit: here is the package.config -

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="Antlr" version="3.4.1.9004" targetFramework="net45" />
  <package id="bootstrap" version="3.2.0" targetFramework="net45" />
  <package id="CodeContracts.Unofficial" version="1.0.0.2" targetFramework="net45" />
  <package id="DotNetOpenAuth.AspNet" version="4.1.4.12333" targetFramework="net45" />
  <package id="DotNetOpenAuth.AspNet" version="4.0.3.12153" targetFramework="net45" />
  <package id="DotNetOpenAuth.Core" version="4.1.4.12333" targetFramework="net45" />
  <package id="DotNetOpenAuth.Core" version="4.0.3.12153" targetFramework="net45" />
  <package id="DotNetOpenAuth.OAuth.Consumer" version="4.1.4.12333" targetFramework="net45" />
  <package id="DotNetOpenAuth.OAuth.Consumer" version="4.0.3.12153" targetFramework="net45" />
  <package id="DotNetOpenAuth.OAuth.Core" version="4.1.4.12333" targetFramework="net45" />
  <package id="DotNetOpenAuth.OAuth.Core" version="4.0.3.12153" targetFramework="net45" />
  <package id="DotNetOpenAuth.OpenId.Core" version="4.1.4.12333" targetFramework="net45" />
  <package id="DotNetOpenAuth.OpenId.Core" version="4.0.3.12153" targetFramework="net45" />
  <package id="DotNetOpenAuth.OpenId.RelyingParty" version="4.1.4.12333" targetFramework="net45"     />
  <package id="DotNetOpenAuth.OpenId.RelyingParty" version="4.0.3.12153" targetFramework="net45" />
  <package id="jQuery" version="2.1.1" targetFramework="net45" />
  <package id="jQuery.UI.Combined" version="1.11.1" targetFramework="net45" />
  <package id="jQuery.Validation" version="1.13.0" targetFramework="net45" />
  <package id="Microsoft.AspNet.Mvc" version="4.0.30506.0" targetFramework="net45" />
  <package id="Microsoft.AspNet.Mvc" version="4.0.20710.0" targetFramework="net45" />
  <package id="Microsoft.AspNet.Mvc.FixedDisplayModes" version="1.0.0" targetFramework="net45" />
  <package id="Microsoft.AspNet.Razor" version="3.2.2" targetFramework="net45" />
  <package id="Microsoft.AspNet.Razor" version="2.0.20710.0" targetFramework="net45" />
  <package id="Microsoft.AspNet.Web.Optimization" version="1.1.3" targetFramework="net45" />
  <package id="Microsoft.AspNet.Web.Optimization" version="1.0.0" targetFramework="net45" />
  <package id="Microsoft.AspNet.WebApi" version="4.0.30506.0" targetFramework="net45" />
  <package id="Microsoft.AspNet.WebApi.Client" version="4.0.30506.0" targetFramework="net45" />
  <package id="Microsoft.AspNet.WebApi.Core" version="4.0.30506.0" targetFramework="net45" />
  <package id="Microsoft.AspNet.WebApi.WebHost" version="4.0.30506.0" targetFramework="net45" />
  <package id="Microsoft.AspNet.WebPages" version="2.0.30506.0" targetFramework="net45" />
  <package id="Microsoft.AspNet.WebPages" version="2.0.20710.0" targetFramework="net45" />
  <package id="Microsoft.AspNet.WebPages.Data" version="3.2.2" targetFramework="net45" />
  <package id="Microsoft.AspNet.WebPages.Data" version="2.0.20710.0" targetFramework="net45" />
  <package id="Microsoft.AspNet.WebPages.OAuth" version="3.2.2" targetFramework="net45" />
  <package id="Microsoft.AspNet.WebPages.OAuth" version="2.0.20710.0" targetFramework="net45" />
  <package id="Microsoft.AspNet.WebPages.WebData" version="3.2.2" targetFramework="net45" />
  <package id="Microsoft.AspNet.WebPages.WebData" version="2.0.20710.0" targetFramework="net45" />
  <package id="Microsoft.jQuery.Unobtrusive.Ajax" version="3.2.2" targetFramework="net45" />
  <package id="Microsoft.jQuery.Unobtrusive.Validation" version="3.2.2" 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="Newtonsoft.Json" version="5.0.4" targetFramework="net45" />
  <package id="UpgradeMvc3ToMvc4" version="1.0.1" targetFramework="net45" />
  <package id="WebGrease" version="1.5.2" targetFramework="net45" />
  <package id="WebGrease" version="1.1.0" targetFramework="net45" />
</packages>

      

+3


source to share


3 answers


According to your package.config file, you have multiple versions of each package installed. Your site won't function properly until you clean it up, especially with regard to WebAPI and MVC. Your best bet is to do "Clean", remove all those non-client-side packages (you can keep jQuery and other client-side libraries) and re-add whatever version you want. You only want 1 version of each when all is said and done.

If you really wanted to make this work without cleaning up the .config package, you can tweak assemblyRedirection in web.config (see here: http://msdn.microsoft.com/en-us/library/7wd6ex19(v=vs.110) .aspx ) and list all requests for one version to another.



You will need to check the WebPages, MVC and WebAPI references mentioned in all web.config files in your web application to ensure they are also versioned correctly.

+3


source


If you have installed whit Nuget , it should install all necessary links.



For further help please provide the .config package

+4


source


Personally, I had to run Tools> NuGet Package Manager> Manage NuGet Packages for Solution ... and update DotNet * packages. *. Please note that the solution I'm working on is a group project hosted on SVN. If one person updates their packages, it can affect other users until they are updated.

0


source







All Articles