Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error Running Code Analysis in VS2012

I receive the following two errors when I try to compile my MVC4 web project:

CA0058 Error Running Code Analysis CA0058 : The referenced assembly 'DotNetOpenAuth.AspNet, Version=4.0.0.0, Culture=neutral, PublicKeyToken=2780ccd10d57b246' could not be found. This assembly is required for analysis and was referenced by: C:\Users\bflynn\Visual Studio Sites\mnp\bin\mnp.dll, C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v2.0\Assemblies\Microsoft.Web.WebPages.OAuth.dll. [Errors and Warnings] (Global)

and

CA0001 Error Running Code Analysis CA0001 : The following error was encountered while reading module 'Microsoft.Web.WebPages.OAuth': Assembly reference cannot 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 tied to that. I have Cleaned, Rebuilt, Open/Closed the program, Uninstalled/Re-installed the package, yet the errors persists.

like image 953
cardiac7 Avatar asked Sep 25 '12 17:09

cardiac7


1 Answers

I just ran into this too.

Don't upgrade DOA to 4.1

It looks like the aspnet dll has a specific version referenced. Altough it's .nuspec file says 4.0+ is ok...

Solution:

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

Install-Package DotNetOpenAuth.AspNet -Version 4.0.4.12182

like image 153
Remco Ros Avatar answered Sep 28 '22 04:09

Remco Ros