microsoft / CodeContracts

Source code for the CodeContracts tools for .NET
Other
883 stars 151 forks source link

Duplicated contracts when ccrewrite is run with out-of-band contract assembly. #336

Open hubuk opened 8 years ago

hubuk commented 8 years ago

Example of this behavior can be observed in TestResults\Out\Deploy\OutOfBand.dll assembly created when running tests from UnitTests project. Rewrite is taking place in Foxtrot\Tests\UnitTests\RewrittenContractTest.cs on line x = RunProcess(deploymentDir, foxtrotPath, "/rewrite /assemblyMode=standard /rw:RewriterMethods.dll,TestRewriterMethods /nobox /throwonfailure /contracts:OutOfBand.Contracts.dll /autoRef:- OutOfBand.dll"); OOB contracts (/contracts: parameter for ccrewrite.exe) seem not to be used in final product during build.

SergeyTeplyakov commented 8 years ago

Can we closed it?

hubuk commented 8 years ago

@SergeyTeplyakov Unfortunately no. This is an issue I found when enabled additional post-rewrite check in foxtrot. It is not critical so I will try to address it some other time.

SergeyTeplyakov commented 8 years ago

@hubuk Ok. But this one will not block us from the new release? Right?

hubuk commented 8 years ago

@SergeyTeplyakov It should not. The problem is not a regression. The only place I found where Out of band contracts are used (/contracts: switch) is in foxtrot tests. Rewriter run by MSBuild is not using this parameter.

SergeyTeplyakov commented 8 years ago

@hubuk Excellent. If you know about any issues/PR that you would really like to see in the upcoming release, please note it here. I'm going to publish new rc-version tomorrow.

hubuk commented 8 years ago

@SergeyTeplyakov I was able to provide one more fix for rewriter (issue #168) in PR #344. In addition the build is broken due to lack of some types used in new contracts for Task class. Fix for this is available as #343.