FxCop cannot resolve links

I am working on a project in C #. Now I configured the Hudson server I installed on the .Net 4 Framework server and the Windows SDK 7.1.

The project builds successfully, but when I start FxCop with

"C:\Program Files (x86)\Microsoft FxCop 1.35\fxcopcmd.exe" /file:CommonServiceTool\bin\Release /out:fxcop-result.xml 

It downloads all the .dll rule files, and after that the following exceptions occur:

 Using system files at: C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319. Could not resolve reference to PresentationFramework. Could not resolve reference to PresentationCore. Could not resolve reference to WindowsBase. 12 exceptions occurred while loading Project1. 00) Could not resolve type reference: [PresentationFramework]System.Windows.StartupEventArgs. 01) Could not resolve type reference: [PresentationFramework]System.Windows.Window. 02) Could not resolve type reference: [PresentationFramework]System.Windows.Controls.HeaderedContentControl. 03) Could not resolve type reference: [PresentationCore]System.Windows.Input.ICommand. 04) Could not resolve member reference: System.Windows.ThemeInfoAttribute::.ctor. ... and so on... 

I am using WPF in a project and I think that FxCop cannot find the WPF libraries. Can someone help me with this?

+4
source share
4 answers

Make sure Project -> Options ... - Spellchecking and Analysis -> "Search the global build cache for missing links" is checked (according to FxCop and GAC Madness ).

+4
source

Are you using fxcopcmd.exe directly or through a plugin? If the first one, try adding the /gac command line /gac . If you use an intermediate runner, what is it?

+3
source

I had a similar problem with fxcopcmd V12. I was able to solve this by explicitly adding

 /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\WindowsBase.dll" 

See: FxCop exception in WPF assembly

+1
source

OK I understood!

FxCop 1.35 does not work with WPF. Now I have installed FxCop 10.0. Now it works. But thank you all for your help!

0
source

Source: https://habr.com/ru/post/1432415/


All Articles