目标存在时的代码分析CA0055

时间:2017-06-20 09:08:27

标签: vb.net visual-studio-2015 code-analysis microsoft.codeanalysis

我正在尝试针对我们拥有的许多不同解决方案首次运行代码分析。每次我收到CA0055错误("无法加载目标"),尽管目标文件确实存在。

我查看了CodeAnalysis日志,但我无法解决它无法做到的事情。

我在Windows 10上运行Visual Studio 2015(Update 3),但我在VS2013上也遇到了这个问题。该项目是一个针对.NET 4.6.2的ASP.NET Web Forms应用程序,但是是从ASP.NET WebForms 2.0开发的。我在控制台应用程序上也遇到了同样的问题。

异常堆栈跟踪如下所示 - 我知道它可能不会继续下去,但看起来加载引用可能会出现某种问题?

我很感激任何建议 - 谢谢。

<Exception Keyword="CA0055" Kind="AssemblyLoad">
   <Type>Microsoft.FxCop.Common.AssemblyLoadException</Type>
   <ExceptionMessage>Could not load c:\PathToFile\FileBeingAnalysed.dll.</ExceptionMessage>
   <InnerType>System.NullReferenceException</InnerType>
   <InnerExceptionMessage>Object reference not set to an instance of an object.</InnerExceptionMessage>
   <InnerStackTrace>   at Microsoft.FxCop.Sdk.TypeNode.GetNestedType(Identifier name)
   at Microsoft.FxCop.Sdk.Duplicator.VisitTypeReference(TypeNode type)
   at Microsoft.FxCop.Sdk.Duplicator.VisitTypeNode(TypeNode type, Identifier mangledName, TypeNodeCollection templateArguments, TypeNode template, Boolean delayVisitToNestedTypes)
   at Microsoft.FxCop.Sdk.TypeNode.GetTemplateInstance(ModuleNode module, TypeNode referringType, TypeNode declaringType, TypeNodeCollection templateArguments)
   at Microsoft.FxCop.Sdk.TypeNode.GetGenericTemplateInstance(ModuleNode module, TypeNodeCollection consolidatedArguments)
   at Microsoft.FxCop.Sdk.Reader.ParseTypeSignature(MemoryCursor sigReader, Boolean&amp; pinned, Boolean&amp; isTypeArgument)
   at Microsoft.FxCop.Sdk.Reader.GetTypeFromSpec(Int32 i)
   at Microsoft.FxCop.Sdk.Reader.DecodeAndGetTypeDefOrRefOrSpec(Int32 codedIndex)
   at Microsoft.FxCop.Sdk.Reader.GetTypeFromDefHelper(Int32 i)
   at Microsoft.FxCop.Sdk.Reader.GetTypeFromDef(Int32 i)
   at Microsoft.FxCop.Sdk.Reader.GetNestedTypes(TypeNode type, Object handle)
   at Microsoft.FxCop.Sdk.TypeNode.get_NestedTypes()
   at Microsoft.FxCop.Sdk.TypeNode.GetNestedType(Identifier name)
   at Microsoft.FxCop.Sdk.Duplicator.VisitTypeReference(TypeNode type)
   at Microsoft.FxCop.Sdk.Duplicator.VisitTypeNode(TypeNode type, Identifier mangledName, TypeNodeCollection templateArguments, TypeNode template, Boolean delayVisitToNestedTypes)
   at Microsoft.FxCop.Sdk.TypeNode.GetTemplateInstance(ModuleNode module, TypeNode referringType, TypeNode declaringType, TypeNodeCollection templateArguments)
   at Microsoft.FxCop.Sdk.TypeNode.GetGenericTemplateInstance(ModuleNode module, TypeNodeCollection consolidatedArguments)
   at Microsoft.FxCop.Sdk.Reader.ParseTypeSignature(MemoryCursor sigReader, Boolean&amp; pinned, Boolean&amp; isTypeArgument)
   at Microsoft.FxCop.Sdk.Reader.GetTypeFromSpec(Int32 i)
   at Microsoft.FxCop.Sdk.Reader.DecodeAndGetTypeDefOrRefOrSpec(Int32 codedIndex)
   at Microsoft.FxCop.Sdk.Reader.GetTypeFromDefHelper(Int32 i)
   at Microsoft.FxCop.Sdk.Reader.GetTypeFromDef(Int32 i)
   at Microsoft.FxCop.Sdk.Reader.GetNestedTypes(TypeNode type, Object handle)
   at Microsoft.FxCop.Sdk.TypeNode.get_NestedTypes()
   at Microsoft.FxCop.Sdk.TypeNode.GetNestedType(Identifier name)
   at Microsoft.FxCop.Sdk.Duplicator.VisitTypeReference(TypeNode type)
   at Microsoft.FxCop.Sdk.Duplicator.VisitTypeNode(TypeNode type, Identifier mangledName, TypeNodeCollection templateArguments, TypeNode template, Boolean delayVisitToNestedTypes)
   at Microsoft.FxCop.Sdk.TypeNode.GetTemplateInstance(ModuleNode module, TypeNode referringType, TypeNode declaringType, TypeNodeCollection templateArguments)
   at Microsoft.FxCop.Sdk.TypeNode.GetGenericTemplateInstance(ModuleNode module, TypeNodeCollection consolidatedArguments)
   at Microsoft.FxCop.Sdk.Reader.ParseTypeSignature(MemoryCursor sigReader, Boolean&amp; pinned, Boolean&amp; isTypeArgument)
   at Microsoft.FxCop.Sdk.Reader.GetTypeFromSpec(Int32 i)
   at Microsoft.FxCop.Sdk.Reader.DecodeAndGetTypeDefOrRefOrSpec(Int32 codedIndex)
   at Microsoft.FxCop.Sdk.Reader.GetTypeFromDefHelper(Int32 i)
   at Microsoft.FxCop.Sdk.Reader.GetTypeFromDef(Int32 i)
   at Microsoft.FxCop.Sdk.Reader.GetTypeIfNotGenericInstance(Int32 codedIndex)
   at Microsoft.FxCop.Sdk.Reader.ConstructCorrectTypeNodeSubclass(Int32 i, Identifier namesp, Int32 firstInterfaceIndex, Int32 lastInterfaceIndex, TypeFlags flags, InterfaceCollection interfaces, Int32 baseTypeCodedIndex, Boolean isSystemEnum)
   at Microsoft.FxCop.Sdk.Reader.GetTypeFromDefHelper(Int32 i)
   at Microsoft.FxCop.Sdk.Reader.GetTypeFromDef(Int32 i)
   at Microsoft.FxCop.Sdk.Reader.GetTypeList(ModuleNode module)
   at Microsoft.FxCop.Sdk.ModuleNode.get_Types()
   at Microsoft.FxCop.Common.AssemblyNodeEx.GetAllModuleReferences(AssemblyNode assembly)
   at Microsoft.FxCop.Common.CommonUtilitiesProvider.GetAssemblyThread()
   at Microsoft.FxCop.Common.CommonUtilitiesProvider.GetAssembly(String fileName, Boolean hookUpResolver, Boolean getDebugInfo, Boolean useGlobalCache)
   at Microsoft.FxCop.Common.CommonUtilitiesProvider.GetAssembly(String fileName, Boolean hookUpResolver)
   at Microsoft.FxCop.Engines.Introspection.IntrospectionAnalysisEngine.CanLoadTargetFile(TargetFile target)
   at Microsoft.FxCop.Common.EngineManager.LoadTargets(TargetFile target, Boolean resetCounts, String loadEngine)</InnerStackTrace>
  </Exception>

0 个答案:

没有答案