Fork me on GitHub

Check No Binding Redirects Task

Motivation

Nuget adds binding redirects for updated assemblies to a project under certain conditions.

If you want to make sure that your project doesn't use binding redirects - with the risk of incompatible assemblies - the Appccelerate.CheckNoBindingRedirectsTask checks that no binding redirects are present in the app or web config file.

Features

Installation

You can install the CheckNoBindingRedirectsTask using nuget. The package id is Appccelerate.CheckNoBindingRedirectsTask.

Configuration

You can overwrite the default behaviour of the CheckHintPathTask by setting properties in the project file.

Exclude Patterns

You can add the property CheckNoBindingRedirectsTaskExcludePatterns to your project file to define exlusion patterns. Binding redirects for assemblies matching one of the exclude patterns will not result in a violation.

The list is a comma separated list of regular expressions.

E.g. <CheckNoBindingRedirectsTaskExcludePatterns>System.Web.*</CheckNoBindingRedirectsTaskExcludePatterns>

TreatWarningsAsErrors

The property TreatWarningsAsErrors defines whether hint path violations result in warnings or errors.

The default value is false.

You can overwrite the behaviour by adding the TreatWarningsAsErrors property to your project file: E.g. <TreatWarningsAsErrors Condition="'$(Configuration)' == 'Release'">true</TreatWarningsAsErrors> This will result in errors for invalid hint paths during a releae build.