Michael Sync

Michael Sync

Crisp, minimal personal blog

28 May 2013

(Unsolved) FxCop + .NET Portable Library Issue


Updated: Please see the status of FxCop/Code Analysis in this post.

Update:

The only workaround that I am using now is that I removed the FxCop from CI and use Code Analysis instead. But you might not want to run the code analysis on every build on developer machine so you can create another configuration setting (maybe CI) and enable the code analysis for that setting or you can use the code analysis switch on MSBUILD.


No. It’s not the problem and solution post. This post is about the issue that we are not able to solve until now. We integrated the standalone version of FxCop with our custom ruleset to make sure all of our projects are following our guideline on our CI (Continuous Integration) server.We have a .NET 4.5 project that is using an open source dependency injection framework called Autofac that has the dependency on the Portable Class library. When we run FxCop for that project, we got the error below.

FxCop Portal Library

Error Message

Microsoft.FxCop.Sdk.FxCopException: The indirectly-referenced Silverlight assembly “System.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes” could not be found. This assembly is not required for analysis, however, analysis results could be incomplete. Silverlight reference assemblies should be specified with the ‘/reference’ switch. This assembly was referenced by: \bin\Autofac.dll.

I am still not able to find the solution yet but what I found is that a lot of people are having the same problem and asking for new version of FxCop for .NET 4.5.

Please vote this “Update standalone FxCop to support .NET 4.5 and Portable Libraries” if you are also looking for Fxcop for .NET 4.5.

Or, If you know the solution or workaround, please share with us. Thanks!