FxCop and GAC Madness

主宰稳场 提交于 2020-01-12 07:39:08

问题


Using FxCop when I try to analyze projects that rely on Patterns and Practices, Enterprise Library Data (among others) 2.0.0.0 - FxCop complains that it can’t: “Locate Assembly Reference” - even though the application dll being analyzed was complied against this version and its in the GAC. If I browse to the GAC try to select the same assembly (I've checked version and public key token) FxCop won't allow me "open" it. The application succeeds in running and definitely makes use of the problem dll.

OS: Seen on both Vista and Windows XP. Versions: Visual Studio 2005 and 2008. FxCop 1.36 Application is complied with VS2005 for .NET 2.0.

I have the same problem if I try to browse the application dll with Reflector.

Clearly it doesn't think this is the same version of the assembly its compiled against. Does anyone know why? Any suggestions for a solution? What am I missing?


回答1:


Check this (FxCop) and this (Reflector) out.


In FxCop, you can select Project - Options... - Spelling & Analysis - (check) Search Global Assembly Cache for missing references


In Reflector, you can select View - Options... - Browser - (check) Automatically resolve references


I find it kind of weird that these options are not enabled by default.



来源:https://stackoverflow.com/questions/848617/fxcop-and-gac-madness

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!