Skip to content
This repository was archived by the owner on Jul 15, 2023. It is now read-only.
This repository was archived by the owner on Jul 15, 2023. It is now read-only.

MSBuild 12.0 Microsoft.CodeContracts.targets imports wrong ContractAnalysis.targets #30

@jbcutting

Description

@jbcutting

The MSBuild v12.0 version of Microsoft.CodeContracts.targets imports $(CodeContractsInstallDir)MsBuild\v4.0\Microsoft.CodeContractAnalysis.targets. This is a relatively minor issue, but causes some problems if you're trying to add the minimum requirements for Code Contracts into your source enlistment to support builds without the extension.

The problem is on line 638 with the definition of the CodeContractAnalysisTargets property. This line is fine in the MSBuild 3.5 and 4.0 versions of the file.

The best way to resolve this would be to set the property to $(MSBuildThisFileDirectory)Microsoft.CodeContractAnalysis.targets, which would prevent the need for the version number in any of the files (4.0 and up - 3.5 doesn't support MSBuildThisFile).

Most of the content could be consolidated to avoid the need for duplicating the file with each version, but this minor change would avoid at least one problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions