Error: Additional code analysis warnings or errors cannot be displayed

I'm getting a couple of errors consistently when I enable Code Analysis on my ASP.NET Web Project in VS 2005 RC1. The build fails, and around 200 warnings from FxCop are displayed. Here are the errors:

Error 204 CA0503 : Additional code analysis warnings or errors cannot be displayed
Error 205FxCopCmd.exe returned error code 8.

I looked up error code 8 for FxCop, and found it to be an "Assembly load error". It did give me a couple of other errors related to the loading of external referenced assemblies (which do exist locally):

Error 1 CA0055 : Could not load XXXXXXX.dll.

I can't understand what the problem is. Those DLLs are in my project's Bin, and when I uncheck the Enable Code Analysis checkbox for the project, it builds fine.

Are there any other preconditions that have to be set properly to get FxCop working for my project? It's obviously performing at least some of the analysis, because I always get around 200 warnings related to various portions of the project. Any suggestions?

[1071 byte] By [CorySeaman] at [2007-12-19]
# 1
Can I trouble you to recover the CodeAnalysisLog.xml file that should be found either in the Analysis_<ProjectName> folder that's a sibling of the web site folder <ProjectName>, or underneath <SolutionDirectory>\<ProjectName>\<Project Guid> depending on which bits you have. If you could post the <Exceptions> nodes at the bottom of the report, the full details there will help us diagnose the issue.

Ordinarily, there's nothing else that needs to be done, but I'd need to see the log to figure out what went wrong in this case.

Thanks
Nick

NickGuerrera-MS at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Visual Studio Code Analysis and Code Metrics...
# 2
I am also getting "FxCopCmd.exe returned error code 8." Here is my Exceptions node...

<Exceptions>
<Exception Keyword="CA0055" Kind="AssemblyLoad">
<Type>Microsoft.FxCop.Common.AssemblyLoadException</Type>
<ExceptionMessage>Could not load App_Licenses.dll.</ExceptionMessage>
<InnerType>Microsoft.FxCop.Sdk.FxCopException</InnerType>
<InnerExceptionMessage>The first successfully loaded assembly for this project was linked against v2.0.50215. 'App_Licenses' was linked against v2.0.50727 and so cannot be analyzed from within the same project.</InnerExceptionMessage>
<InnerStackTrace> at Microsoft.FxCop.Engines.Introspection.IntrospectionAnalysisEngine.CanLoadTargetFile(TargetFile target)
at Microsoft.FxCop.Common.EngineManager.LoadTargets(TargetFile target, Boolean resetCounts, String loadEngine)</InnerStackTrace>
</Exception>
<Exception Keyword="CA0055" Kind="AssemblyLoad">
<Type>Microsoft.FxCop.Common.AssemblyLoadException</Type>
<ExceptionMessage>Could not load App_WebReferences.dll.</ExceptionMessage>
<InnerType>Microsoft.FxCop.Sdk.FxCopException</InnerType>
<InnerExceptionMessage>The first successfully loaded assembly for this project was linked against v2.0.50215. 'App_WebReferences' was linked against v2.0.50727 and so cannot be analyzed from within the same project.</InnerExceptionMessage>
<InnerStackTrace> at Microsoft.FxCop.Engines.Introspection.IntrospectionAnalysisEngine.CanLoadTargetFile(TargetFile target)
at Microsoft.FxCop.Common.EngineManager.LoadTargets(TargetFile target, Boolean resetCounts, String loadEngine)</InnerStackTrace>
</Exception>
<Exception Keyword="CA0055" Kind="AssemblyLoad">
<Type>Microsoft.FxCop.Common.AssemblyLoadException</Type>
<ExceptionMessage>Could not load App_Web_co9tdufd.dll.</ExceptionMessage>
<InnerType>Microsoft.FxCop.Sdk.FxCopException</InnerType>
<InnerExceptionMessage>The first successfully loaded assembly for this project was linked against v2.0.50215. 'App_Web_co9tdufd' was linked against v2.0.50727 and so cannot be analyzed from within the same project.</InnerExceptionMessage>
<InnerStackTrace> at Microsoft.FxCop.Engines.Introspection.IntrospectionAnalysisEngine.CanLoadTargetFile(TargetFile target)
at Microsoft.FxCop.Common.EngineManager.LoadTargets(TargetFile target, Boolean resetCounts, String loadEngine)</InnerStackTrace>
</Exception>
<Exception Keyword="CA0055" Kind="AssemblyLoad">
<Type>Microsoft.FxCop.Common.AssemblyLoadException</Type>
<ExceptionMessage>Could not load App_Web_lp3yo43d.dll.</ExceptionMessage>
<InnerType>Microsoft.FxCop.Sdk.FxCopException</InnerType>
<InnerExceptionMessage>The first successfully loaded assembly for this project was linked against v2.0.50215. 'App_Web_lp3yo43d' was linked against v2.0.50727 and so cannot be analyzed from within the same project.</InnerExceptionMessage>
<InnerStackTrace> at Microsoft.FxCop.Engines.Introspection.IntrospectionAnalysisEngine.CanLoadTargetFile(TargetFile target)
at Microsoft.FxCop.Common.EngineManager.LoadTargets(TargetFile target, Boolean resetCounts, String loadEngine)</InnerStackTrace>
</Exception>
<Exception Keyword="CA0055" Kind="AssemblyLoad">
<Type>Microsoft.FxCop.Common.AssemblyLoadException</Type>
<ExceptionMessage>Could not load App_Web_xzhjeyia.dll.</ExceptionMessage>
<InnerType>Microsoft.FxCop.Sdk.FxCopException</InnerType>
<InnerExceptionMessage>The first successfully loaded assembly for this project was linked against v2.0.50215. 'App_Web_xzhjeyia' was linked against v2.0.50727 and so cannot be analyzed from within the same project.</InnerExceptionMessage>
<InnerStackTrace> at Microsoft.FxCop.Engines.Introspection.IntrospectionAnalysisEngine.CanLoadTargetFile(TargetFile target)
at Microsoft.FxCop.Common.EngineManager.LoadTargets(TargetFile target, Boolean resetCounts, String loadEngine)</InnerStackTrace>
</Exception>
<Exception Keyword="CA0055" Kind="AssemblyLoad">
<Type>Microsoft.FxCop.Common.AssemblyLoadException</Type>
<ExceptionMessage>Could not load HGVC.Framework.dll.</ExceptionMessage>
<InnerType>Microsoft.FxCop.Sdk.FxCopException</InnerType>
<InnerExceptionMessage>The first successfully loaded assembly for this project was linked against v2.0.50215. 'HGVC.Framework' was linked against v2.0.50727 and so cannot be analyzed from within the same project.</InnerExceptionMessage>
<InnerStackTrace> at Microsoft.FxCop.Engines.Introspection.IntrospectionAnalysisEngine.CanLoadTargetFile(TargetFile target)
at Microsoft.FxCop.Common.EngineManager.LoadTargets(TargetFile target, Boolean resetCounts, String loadEngine)</InnerStackTrace>
</Exception>
<Exception Keyword="CA0055" Kind="AssemblyLoad">
<Type>Microsoft.FxCop.Common.AssemblyLoadException</Type>
<ExceptionMessage>Could not load HGVC.HGVCentral.Business.dll.</ExceptionMessage>
<InnerType>Microsoft.FxCop.Sdk.FxCopException</InnerType>
<InnerExceptionMessage>The first successfully loaded assembly for this project was linked against v2.0.50215. 'HGVC.HGVCentral.Business' was linked against v2.0.50727 and so cannot be analyzed from within the same project.</InnerExceptionMessage>
<InnerStackTrace> at Microsoft.FxCop.Engines.Introspection.IntrospectionAnalysisEngine.CanLoadTargetFile(TargetFile target)
at Microsoft.FxCop.Common.EngineManager.LoadTargets(TargetFile target, Boolean resetCounts, String loadEngine)</InnerStackTrace>
</Exception>
<Exception Keyword="CA0055" Kind="AssemblyLoad">
<Type>Microsoft.FxCop.Common.AssemblyLoadException</Type>
<ExceptionMessage>Could not load HGVC.HGVCentral.Common.dll.</ExceptionMessage>
<InnerType>Microsoft.FxCop.Sdk.FxCopException</InnerType>
<InnerExceptionMessage>The first successfully loaded assembly for this project was linked against v2.0.50215. 'HGVC.HGVCentral.Common' was linked against v2.0.50727 and so cannot be analyzed from within the same project.</InnerExceptionMessage>
<InnerStackTrace> at Microsoft.FxCop.Engines.Introspection.IntrospectionAnalysisEngine.CanLoadTargetFile(TargetFile target)
at Microsoft.FxCop.Common.EngineManager.LoadTargets(TargetFile target, Boolean resetCounts, String loadEngine)</InnerStackTrace>
</Exception>
</Exceptions>
MikeOtown at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Visual Studio Code Analysis and Code Metrics...
# 3

Hi,

I'm very sorry for the long delay in responding, I was on vacation.

This error is prompted because the HGVC.* assemblies are built against .NET 2.0 Beta 2 while the project is using .NET 2.0 final. If you use .NET 2.0 final bits for the HGVC.* references, this will be resolved.

Thanks

Nick

NickGuerrera-MS at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Visual Studio Code Analysis and Code Metrics...
# 4

Nick,

Is there a way to isolate those assemblies that are not .NET 2.0 final. I'm referencing a product totally out of my control and it is unlikely I can affect an change there.

Thanks

Adam

AdamZ at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Visual Studio Code Analysis and Code Metrics...
# 5
I too am getting this error on my project. Was there ever a fix found for assemblies that I don't have the source code for?
BerndVanSkiver at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Visual Studio Code Analysis and Code Metrics...
# 6

Unfortunately, there is no available workaround if you do not own the code. We are planning to address this issue in Service Pack 1 of Visual Studio 2005.

Nick

NickGuerrera-MS at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Visual Studio Code Analysis and Code Metrics...
# 7

Hi Nick,

We are getting the following error when we implement Security Rules Codes Analysis, as we are referring to .Net 1.1 assemblies which are owned by third party and cannot be upgraded to .Net 2.0.

CA0055 - Could not load .....dll

Is this issues addressed in SP1 of VS2005 ?

Thanks in advanace

Murali Ram

RamMSDN at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Visual Studio Code Analysis and Code Metrics...
# 8

Hi Murali,

This fix is included in SP1 Beta 1. Let us know if you see any issues with the fix...

Regards,

Jeffrey

JeffreyvanGogh-MSFT at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Visual Studio Code Analysis and Code Metrics...
# 9

Hi Jeffrey,

Can i know where should i install sp1 either on TFS or on all dev machines or on both.

RamMSDN at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Visual Studio Code Analysis and Code Metrics...

Visual Studio Team System

Site Classified