Code Analysis throws an error that it cannot resolve the VS2010 references under VS2012

Apr 22, 2013 at 2:27 PM
Edited Apr 22, 2013 at 2:28 PM
Similar to the 2012 issue with resolving the references during build, (which can be solved with a few assembly bindings), we got a similar issue when running Code Analysis against the project containing the CodedUI Code first tests.

By changing the configuration of FxCop to resolve by strong name (excl version), we worked around this.

This is a global setting which can be found in the fxcopcmd.exe.config file which is stored here: C:\Program Files (x86)\Microsoft Visual Studio 11.0\Team Tools\Static Analysis Tools\FxCop.
  <appSettings>
    <!-- 
        Indicates the mode to use when matching references to assemblies.
    
         None - Do not match strong names at all, any assembly with the same file name is considered a match.
                                    
         StrongName - Strong names including assembly name, version, culture and public key token must exactly match.
                                    
         StrongNameIgnoringVersion - Strong names including assembly name, culture and public key token must exactly match. Assemblies with an equal or greater version are considered a match.                      
    -->
    <add key="AssemblyReferenceResolveMode" value="StrongNameIgnoringVersion" />
    
  </appSettings>