Reputation: 2979
I'm trying to Run Code Analysis manually on one project and I'm getting following error: CA0055: Could not load xxx.dll.
This is detailed log from xml log:
<Exception Keyword="CA0055" Kind="AssemblyLoad">
<Type>Microsoft.FxCop.Common.AssemblyLoadException</Type>
<ExceptionMessage>Could not load D:\...\bin\debug\xxx.dll.</ExceptionMessage>
<InnerType>System.IO.InvalidDataException</InnerType>
<InnerExceptionMessage>Invalid type for custom attribute argument</InnerExceptionMessage>
<InnerStackTrace> at
Phx.Metadata.LoaderImplementation.DeserializePointerTypeConstant(Type type,
AttributeBlobReader& blobReader, Boolean doResolveEnums)
at Phx.Metadata.LoaderImplementation.DeserializeConstant(Type type,
AttributeBlobReader& blobReader, Boolean doResolveEnums)
at Phx.Metadata.MetadataLoader.ParseCustomAttribute(AttributeSymbol attributeSymbol,
Boolean doResolveEnums)
at Microsoft.FxCop.Engines.Phoenix.AssemblyLoader.LoadAttributes(List`1 attributes,
MetadataLoader metadataLoader)
at Microsoft.FxCop.Engines.Phoenix.AssemblyLoader.LoadAttributes(ProgramUnit
programUnit, MetadataLoader metadataLoader)
at Microsoft.FxCop.Engines.Phoenix.AssemblyLoader.LoadAssembly(String filePath)
at Microsoft.FxCop.Engines.Phoenix.PhoenixAnalysisEngine.AnalyzeInternal()
</InnerStackTrace>
</Exception>
The xxx.dll exists in the path and the access is allowed.
Can somebody help what can be wrong?
thanks
Upvotes: 2
Views: 1911
Reputation: 20992
You have probably encountered a bug in the Phoenix assembly loader. Unfortunately, the exception details don't contain any information regarding which custom attribute Phoenix was attempting to parse when it bombed, so it's pretty much impossible to guess if there's a workaround available to you. If you're not able to share the assembly that it causing the problem, then your best bet would be to attach a debugger to the fxcopcmd.exe process so that you can try to extract more information about the problematic attribute.
If you're not able to do this, but you could share the problem DLL with Microsoft, you might want to consider uploading it in a private bug report at https://connect.microsoft.com/VisualStudio/Feedback.
Upvotes: 1