简体   繁体   中英

How to add .NET 3.5 and .NET 4.0 assemblies to FxCop code analysis?

I want to analyze a solution that contains projects targeting .NET 3.5 SP1 and some other projects targeting .NET 4 with some dependencies to .NET 3.5 libraries.

When I try to add both assemblies, one for .NET 3.5 and another for .NET 4, FxCop throws an exception:

AssemblyLoadException
Conflicting target platforms
'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' vs
'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

Is there any way to tell FxCop to only use version 4.0.0.0?

Is there any way to tell FxCop to only use version 4.0.0.0?

No, I don't think there is - you will need one FxCop project for the projects targeting .NET 3.5, and another for those targeting .NET 4.0.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM