Igorbek/CodeContracts.MSBuild

Rewrite aborted due to metadata errors (VS2017)

Closed this issue · 1 comments

CodeContracts.MSBuild.1.12.0 (NuGet package).
I have simple test application. There're the following code in it:

public sealed class MyEnumToStringConerter<TEnum, TResources> : EnumConverter
{
    public MyEnumToStringConerter(): base(typeof(TEnum)) { }
}

[TypeConverter(typeof(MyEnumToStringConerter<MyEnum, Resources>))]
public enum MyEnum
{
    Alpha,
    Beta,
    Gamma
}

Resources here are project resources.

This's the ccrewriter configuration:

<CodeContractsEnableRuntimeChecking>True</CodeContractsEnableRuntimeChecking>
<CodeContractsRuntimeThrowOnFailure>True</CodeContractsRuntimeThrowOnFailure>
<CodeContractsSuggestRequires>True</CodeContractsSuggestRequires>
<CodeContractsRunInBackground>True</CodeContractsRunInBackground>
<CodeContractsShowSquigglies>True</CodeContractsShowSquigglies>
<CodeContractsEmitXMLDocs>True</CodeContractsEmitXMLDocs>
<CodeContractsCacheAnalysisResults>True</CodeContractsCacheAnalysisResults>
<CodeContractsRuntimeCheckingLevel>Full</CodeContractsRuntimeCheckingLevel>
<CodeContractsReferenceAssembly>Build</CodeContractsReferenceAssembly>
<CodeContractsAnalysisWarningLevel>0</CodeContractsAnalysisWarningLevel>
<CodeContractsAssertsToContractsCheckBox>True</CodeContractsAssertsToContractsCheckBox>
<CodeContractsRedundantTests>True</CodeContractsRedundantTests>
<CodeContractsMissingPublicRequiresAsWarnings>True</CodeContractsMissingPublicRequiresAsWarnings>
<CodeContractsInferEnsuresAutoProperties>True</CodeContractsInferEnsuresAutoProperties>
<CodeContractsNecessaryEnsures>True</CodeContractsNecessaryEnsures>
<CodeContractsSuggestReadonly>True</CodeContractsSuggestReadonly>
<CodeContractsBeingOptimisticOnExternal>True</CodeContractsBeingOptimisticOnExternal>

On build I got next error:

Could not resolve type reference: [mscorlib]CCTest.MyEnum,CCTest.Properties.Resources.

@ds1709 thank you for contacting. This project (this repo) is not the CodeContracts implementation. It is an integration with MSBuild.
To report an issue in code re-writer please refer to the implementation repo: https://github.com/Microsoft/CodeContracts