提问人:alergy 提问时间:6/20/2017 更新时间:9/21/2017 访问量:349
目标存在时的代码分析 CA0055
Code Analysis CA0055 when target exists
问:
我第一次尝试针对我们拥有的许多不同的解决方案运行代码分析。每次我都收到错误(“无法加载目标”),尽管目标文件确实存在。CA0055
我查看了 CodeAnalysis 日志,但无法确定它不能做什么。
我在 Windows 2015 上运行 Visual Studio 10 (Update 3),但我在 VS2013 上也遇到了这个问题。该项目是面向 .NET 4.6.2 的 ASP.NET Web 窗体应用,但开发自 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& pinned, Boolean& 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& pinned, Boolean& 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& pinned, Boolean& 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>
答: 暂无答案
评论