English 中文(简体)
FxCop: control assembly referenced by analyzed assembly not being loaded
原标题:

FWIW: Windows 7 64bit, Compact Framework v3.5, FxCop v1.36 (running fxcopcmd.exe)

I m having problems getting FxCop 1.36 to run correctly. I m analyzing a compact framework application with the globalization rules from http://www.dotneti18n.com/Downloads.aspx

the .exe that i am analyzing has a reference to a 3rd party control suite: resco.outlookcontrols.cf.dll. When fxcop runs and analyzes my app, it blows up saying that it cannot find this assembly. I ve checked, re-checked, and check 30 more times that all of the assemblies needed to run the app are in the same folder as the one being analyzed - including the resco dlls.

using fusion log viewer, i m able to get this information:

LOG: DisplayName = Resco.OutlookControls.CF3, Version=6.7.0.0, Culture=neutral, PublicKeyToken=7444f602060105f9
 (Fully-specified)
LOG: Appbase = file:///D:/Dev/TA/Tools/FxCop/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = NULL
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: D:DevTAToolsFxCopfxcopcmd.exe.Config
LOG: Using machine configuration file from C:WindowsMicrosoft.NETFrameworkv2.0.50727configmachine.config.
LOG: Post-policy reference: Resco.OutlookControls.CF3, Version=6.7.0.0, Culture=neutral, PublicKeyToken=7444f602060105f9
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///D:/Dev/TA/Tools/FxCop/Resco.OutlookControls.CF3.DLL.
LOG: Attempting download of new URL file:///D:/Dev/TA/FxCop/Resco.OutlookControls.CF3/Resco.OutlookControls.CF3.DLL.
LOG: Attempting download of new URL file:///D:/Dev/TA/FxCop/Rules/Resco.OutlookControls.CF3.DLL.
LOG: Attempting download of new URL file:///D:/Dev/TA/FxCop/Rules/Resco.OutlookControls.CF3/Resco.OutlookControls.CF3.DLL.
LOG: Attempting download of new URL file:///D:/Dev/TA/FxCop/Engines/Introspection/Resco.OutlookControls.CF3.DLL.
LOG: Attempting download of new URL file:///D:/Dev/TA/FxCop/Engines/Introspection/Resco.OutlookControls.CF3/Resco.OutlookControls.CF3.DLL.
LOG: Attempting download of new URL file:///D:/Dev/TA/FxCop/Resco.OutlookControls.CF3.EXE.
LOG: Attempting download of new URL file:///D:/Dev/TA/FxCop/Resco.OutlookControls.CF3/Resco.OutlookControls.CF3.EXE.
LOG: Attempting download of new URL file:///D:/Dev/TA/FxCop/Rules/Resco.OutlookControls.CF3.EXE.
LOG: Attempting download of new URL file:///D:/Dev/TA/FxCop/Rules/Resco.OutlookControls.CF3/Resco.OutlookControls.CF3.EXE.
LOG: Attempting download of new URL file:///D:/Dev/TA/FxCop/Engines/Introspection/Resco.OutlookControls.CF3.EXE.
LOG: Attempting download of new URL file:///D:/Dev/TA/FxCop/Engines/Introspection/Resco.OutlookControls.CF3/Resco.OutlookControls.CF3.EXE.
LOG: All probing URLs attempted and failed.

here s the part that is really frustrating me: the fxcop documentation (here http://msdn.microsoft.com/en-us/library/bb429449%28VS.80%29.aspx ) says that it will load up all referenced assemblies from either the same folder that the analyzed assembly is in, or from a folder referenced by the /directory: command line option.

it s not living up to the documented promises. the file does exist in the same folder as the one being analyzed and i have tried passing the folder in as a /directory: command line option. i ve even set the AssemblyReferenceDirectories element in the .fxcop file. yet the only places that are searched, according to the fusion log, are the usual locations for probing.

and fyi - i tried updating the probing settings in the fxcopcmd.exe.config - won t work because the folder of the assembly being analyzed is not under the root folder of the fxcop tool, so it gives me a warning saying it won t be probed.

anyone else have this problem? anyone have a solution?

thanks

最佳回答

the problem turned out to be multi-threaded analysis. turning that off for the build server got it working.

问题回答

I would concur with Procmon (http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx) (Tweeted it to you, but not sure if you could see).

It ll show any disk activity of what FxCop is trying to access, and flag if it can t find something. It just pump out a lot of detail, it just takes a bit of time to master the filters and you re away.

Is this CF application compiled using the Any CPU configuration? Is the Resco controls assembly 32-bit only?

I ve had problems on an x64 machine with the System.Data.SQLite binary (which is 32-bit) and compiling against Any CPU. The workaround was to change the project to compile using the x86 configuration in Visual Studio instead of Any CPU.





相关问题
Manually implementing high performance algorithms in .NET

As a learning experience I recently tried implementing Quicksort with 3 way partitioning in C#. Apart from needing to add an extra range check on the left/right variables before the recursive call, ...

Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How do I compare two decimals to 10 decimal places?

I m using decimal type (.net), and I want to see if two numbers are equal. But I only want to be accurate to 10 decimal places. For example take these three numbers. I want them all to be equal. 0....

Exception practices when creating a SynchronizationContext?

I m creating an STA version of the SynchronizationContext for use in Windows Workflow 4.0. I m wondering what to do about exceptions when Post-ing callbacks. The SynchronizationContext can be used ...

Show running instance in single instance application

I am building an application with C#. I managed to turn this into a single instance application by checking if the same process is already running. Process[] pname = Process.GetProcessesByName("...

How to combine DataTrigger and EventTrigger?

NOTE I have asked the related question (with an accepted answer): How to combine DataTrigger and Trigger? I think I need to combine an EventTrigger and a DataTrigger to achieve what I m after: when ...

热门标签