Giter Club home page Giter Club logo

codecontracts.msbuild's People

Contributors

bassill avatar ericmaino avatar igorbek avatar kkm000 avatar lexcess avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

codecontracts.msbuild's Issues

Rewrite aborted due to metadata errors (VS2017)

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.

Error when build with dotnet build

%UserName%\.nuget\packages\codecontracts.msbuild\1.13.0-rc\Contracts\MsBuild\vCurrent\Microsoft.CodeContracts.targets(276,5): 
error MSB4062: 
The "Microsoft.Build.Tasks.GetFrameworkSdkPath" task could not be loaded from the assembly Microsoft.Build.Tasks.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.  
Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. 

I tried to copy v15.0 to vCurrent. No result

Visual Studio 2019 Support

Do you have any plans to support Visual Studio 2019? VS2019 projects that reference the latest version of this NuGet package will not load, they produce an error in the Output window:

C:\solution-path\project-folder\project-name.csproj : error  : The imported project "C:\solution-path\packages\CodeContracts.MSBuild.1.12.0\Contracts\MsBuild\vCurrent\Microsoft.CodeContracts.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.  C:\solution-path\packages\CodeContracts.MSBuild.1.12.0\build\CodeContracts.MSBuild.targets

If there is a "quick" work around in the mean time I would appreciate that as well.

Thank you for making this package available, it has been very useful!

BadImageFormatException with enabled runtime checking

How to reproduce:

  1. Clone https://github.com/FubarDevelopment/QuickGraph
  2. Build
  3. Run the Boost test

Used version: 1.12.0

This are the properties:

  <PropertyGroup Condition=" '$(TargetFramework)' == 'net461' and '$(Configuration)' == 'Debug' ">
    <CodeContractsEnableRuntimeChecking>True</CodeContractsEnableRuntimeChecking>
    <CodeContractsRuntimeOnlyPublicSurface>False</CodeContractsRuntimeOnlyPublicSurface>
    <CodeContractsRuntimeThrowOnFailure>True</CodeContractsRuntimeThrowOnFailure>
    <CodeContractsRuntimeCallSiteRequires>False</CodeContractsRuntimeCallSiteRequires>
    <CodeContractsRuntimeSkipQuantifiers>False</CodeContractsRuntimeSkipQuantifiers>
    <CodeContractsRunCodeAnalysis>False</CodeContractsRunCodeAnalysis>
    <CodeContractsNonNullObligations>True</CodeContractsNonNullObligations>
    <CodeContractsBoundsObligations>True</CodeContractsBoundsObligations>
    <CodeContractsArithmeticObligations>False</CodeContractsArithmeticObligations>
    <CodeContractsEnumObligations>False</CodeContractsEnumObligations>
    <CodeContractsPointerObligations>False</CodeContractsPointerObligations>
    <CodeContractsRedundantAssumptions>False</CodeContractsRedundantAssumptions>
    <CodeContractsInferRequires>False</CodeContractsInferRequires>
    <CodeContractsInferEnsures>False</CodeContractsInferEnsures>
    <CodeContractsSuggestRequires>True</CodeContractsSuggestRequires>
    <CodeContractsSuggestEnsures>False</CodeContractsSuggestEnsures>
    <CodeContractsDisjunctiveRequires>False</CodeContractsDisjunctiveRequires>
    <CodeContractsRunInBackground>True</CodeContractsRunInBackground>
    <CodeContractsShowSquigglies>False</CodeContractsShowSquigglies>
    <CodeContractsUseBaseLine>False</CodeContractsUseBaseLine>
    <CodeContractsEmitXMLDocs>False</CodeContractsEmitXMLDocs>
    <CodeContractsCustomRewriterAssembly />
    <CodeContractsCustomRewriterClass />
    <CodeContractsLibPaths />
    <CodeContractsExtraRewriteOptions />
    <CodeContractsExtraAnalysisOptions />
    <CodeContractsBaseLineFile />
    <CodeContractsCacheAnalysisResults>True</CodeContractsCacheAnalysisResults>
    <CodeContractsRuntimeCheckingLevel>Full</CodeContractsRuntimeCheckingLevel>
    <CodeContractsReferenceAssembly>Build</CodeContractsReferenceAssembly>
    <CodeContractsAnalysisWarningLevel>0</CodeContractsAnalysisWarningLevel>
  </PropertyGroup>

EDIT: I also created an issue in the original repository: microsoft/CodeContracts#502

Support for VS 2015

Current package doesn't work with VS 2015 build, because of the error:
..\packages\CodeContracts.MSBuild.1.7.11202.1001\build\CodeContracts.MSBuild.targets(6,5): error MSB4019: The imported project "..\packages\CodeContracts.MSBuild.1.7.11202.1001\Contracts\MsBuild\v14.0\Microsoft.CodeContracts.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk. [..\Sources\WNP.Listener\Core\Core.csproj]

The problem is that there is no v14.0 directory in the package. Please update the nugget package with latest MsBuild version.

How to install and use it

I just upload the github CodeContracts.MSBuild, runs my fallcreatorupdate app with some code contract in it but the debugger just fails when reaching some false assert.
How did I don wrong. Is there some other stuff to install in VS 2017?
Thanks

Reading assembly 'Unity.Abstractions' generate System.OutOfMemoryException

When in project used package Unity version="5.0.2" and CodeContracts.MSBuild version="1.12.0" then build error with output:

2>  Reading assembly 'Unity.Abstractions' from 'C:\Work.NET\GitHub\NewPlatform.Flexberry.ORM.ODataService\packages\Unity.5.0.2\lib\net45\Unity.Abstractions.dll' resulted in errors.
2>  	Выдано исключение типа "System.OutOfMemoryException".
2>ccrewrite : error : Rewrite aborted due to metadata errors. Check output window
2>  elapsed time: 1341,929ms

Simple documentation

Need to write simple documentation in README, such as:

  • Installation
  • How to use in VS 2017
  • MSBuild properties
  • Best practices
  • Links to original project (Microsoft Contracts)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.