locked
FxCop 1.36: 'Referenced assembly could not be found' for assemblies in GAC RRS feed

  • Question

  • I am using FxCop 1.36 and VS2008 SP1.

     

    We have a number of solutions and projects in our organization.  Some are placed in the GAC by a post-build event.  These projects exist within our solutions and are added as project references to other projects.  Projects that reference these GAC assemblies do not create local copies of them, and when we run FxCop on those projects, it fails to resolve those assemblies.

     

    Since the assemblies are installed into the GAC after being built, and they are all set to version 1.0.0.0, I am confident there is not an assembly version problem.

     

    Of course I can tell the project file where the assembly is located, and it's nice that it remembers, but it seems like FxCop should be able to reference assemblies in the GAC directly.  Can anyone point me towards what I might be doing wrong?  I have created a small test solution that reproduces this problem on multiple computers in my organization; it is available at the following URL: http://www.crazyfarts.com/codesamples/FxCopGacTest.zip

     

    Thanks in advance for your time!

    Thursday, October 2, 2008 7:37 PM

Answers

  • In FxCop 1.36 go to menu "Project"
    Select "Options..."
    In the tab "Spellings & Analysis" select "Search Global Assembly Cache for missing references" option

    That's all
    Saturday, October 4, 2008 1:08 AM

All replies

  • In FxCop 1.36 go to menu "Project"
    Select "Options..."
    In the tab "Spellings & Analysis" select "Search Global Assembly Cache for missing references" option

    That's all
    Saturday, October 4, 2008 1:08 AM
  • How is  this set in Visual Studio 2008 / OR with msbuild settings file ?
    Anup Pachlag
    Monday, May 4, 2009 8:25 PM
  • You don't need to set this in Visual Studio/MSBuild - it is automatically turned on.
    Managed Extensibility Framework Team | My Blog: http://davesbox.com
    Friday, June 19, 2009 2:52 PM
    Moderator
  • Hi,

    I've experienced the same problem with FxCop, when launched with MSBuild OUTSIDE Visual Studio (using MSBuild Community Tasks).

    Is there a workaround?

    Regards,

    Olivier.
    Monday, July 20, 2009 3:21 PM
  • Hi Victor..

    I am getting the same error while using fxcop metrics.exe

    I tried with the above fix but it didnt work.. Is there any workaround for fxcop metrics.exe having the same issue?

    Thanks,

    Ashish

    Friday, October 26, 2012 9:46 AM
  • You need to pass the '/searchgac' commandline option.

    My blog: blog.jessehouwing.nl

    Friday, October 26, 2012 9:23 PM