Error performing code analysis in VS2012

When I try to compile my MVC4 web project, I get the following two errors:

CA0058 Runtime Code Analysis Error CA0058: Reference assembly 'DotNetOpenAuth.AspNet, Version = 4.0.0.0, Culture = neutral, PublicKeyToken = 2780ccd10d57b246' was not found. This assembly is required for the analysis referred to: C: \ Users \ bflynn \ Visual Studio Sites \ mnp \ bin \ mnp.dll, C: \ Program Files (x86) \ Microsoft ASP.NET \ ASP.NET Web Pages \ v2.0 \ assembly \ Microsoft.Web.WebPages.OAuth.dll. [Errors and warnings] (global)

and

CA0001 Runtime code analysis error CA0001: The following error occurred while reading the Microsoft.Web.WebPages.OAuth module: The assembly reference could not be resolved: DotNetOpenAuth.AspNet, Version = 4.0.0.0, Culture = neutral, PublicKeyToken = 2780ccd10d57b246. [Errors and warnings] (global)

I recently added the DotNetOpenAuth.AspNet package to the application and it seems to be tied to this. I cleaned, restored, opened / closed the program, uninstalled / reinstalled the package, but the errors persist.

+7
source share
6 answers

I also came across this.

Do not upgrade DOA to 4.1

It looks like the aspnet dll has a specific version. Although this is a .nuspec file says 4.0+ is fine ...

Decision:

Uninstall-Package -Force each DotNetOpenAuth package (core / aspnet / oauth / openid, etc.)

Installation package DotNetOpenAuth.AspNet -Version 4.0.4.12182

+5
source

I used this to solve the problem:

 1. Uninstall-Package Microsoft.AspNet.WebPages.OAuth –RemoveDependencies 2. Install-Package DotNetOpenAuth.AspNet -Version 4.0.4.12182 3. Install-Package Microsoft.AspNet.WebPages.OAuth 
+5
source

I came across the same question the other day and reported this http://aspnetwebstack.codeplex.com/workitem/443

+1
source

The issue was reported on September 21, 2012. ( http://aspnetwebstack.codeplex.com/workitem/443 )

It was closed on June 5, 2013 with the message:

The next version of MVC will not be dependent on DotNetOpenAuth. Use the recommended workarounds below.

So, I used a workaround overflow https://stackoverflow.com/a/377632/

0
source
0
source

I had the same problem. Although the problem with code analysis was fixed, the web application did not start due to the following error.

Failed to 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)

It appears that web.config has not been cleared as part of the uninstall. I had to remove the following dependent assembly from web.config in the runtime / assemblyBinding section.

  <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="DotNetOpenAuth.Core" publicKeyToken="2780ccd10d57b246" /> <bindingRedirect oldVersion="0.0.0.0-4.3.0.0" newVersion="4.3.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="DotNetOpenAuth.AspNet" publicKeyToken="2780ccd10d57b246" /> <bindingRedirect oldVersion="0.0.0.0-4.3.0.0" newVersion="4.3.0.0" /> </dependentAssembly> <dependentAssembly> </dependentAssembly> </assemblyBinding> </runtime> 

Details can be found at http://www.bigcode.net/2013/07/error-running-code-analysis-in-vs2012.html

0
source

All Articles