BT

InfoQ Homepage News FxCop Rule for Multi-Targeting

FxCop Rule for Multi-Targeting

Bookmarks

Multi-targeting in Visual Studio 2008 leads to a new set of problems. With .NET 3.5 bringing new features to the core assemblies, care must be taken when targeting .NET 2.0. Otherwise, an application can be compiled successfully but fail to run due to missing methods. One way to handle this is to use Krzysztof Cwalina's Multitargeting rule for FxCop.

FxCop, which provides code analysis for Visual Studio, allows developers to create the own custom rules. FxCop rules work against IL, not source code, so they are automatically available for any compiled .NET language.

Krzysztof has provided a sample rule that issues warnings whenever a new class or method is used. The list of new classes and methods is provided along with the source code. This rule could also be adapted to discourage the use of other classes deemed inappropriate for the project. One possibility is to get a list of Mono classes not yet implemented and filter against them.

Rate this Article

Adoption
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

BT

Is your profile up-to-date? Please take a moment to review and update.

Note: If updating/changing your email, a validation request will be sent

Company name:
Company role:
Company size:
Country/Zone:
State/Province/Region:
You will be sent an email to validate the new email address. This pop-up will close itself in a few moments.