Using code contracts in library code built with MSBuild

I started using Code Contracts in all the new code that I write, for example, in the framework library that I create help bootstrap IoC , O / RM , etc., in an ASP.NET MVC application. I wrote a simple script assembly for this framework library that looks like this:

@echo off
echo.
echo Cleaning build output (removing 'obj' and 'bin' folders)...
for /f "tokens=*" %%G in ('dir /b /ad /s bin') do rmdir /s /q "%%G"
for /f "tokens=*" %%G in ('dir /b /ad /s obj') do rmdir /s /q "%%G"
rmdir /s /q build
echo.
echo Starting the build...
call "%VS100COMNTOOLS%\vsvars32.bat"
msbuild Integration.build /target:Build
echo.
echo Done!
pause

This does not work. What I get in my folder build, if I run it, is for some reason assemblies that are not completely overwritten ccrewritenext to the files .pdb.original, .rewrittenand .csproj.FileListAbsolute.txtthat clog the output directory.

, Visual Studio 2010, 3-7 . , .pdb.original .rewritten.

, , , Visual Studio 2010 - , Visual Studio 2010 MSBuild , script build. , .

, Jon , ccrewrite - , . Integration.build ( .csproj), , .

, : MSBuild , Visual Studio 2010 , ccrewrite , , .rewritten .pdb.original? - , MSBuild, ?

+3
2

script. Visual Studio - MSBuild, . , , Tools | Options | Build... , , , .

​​ ? MSBuild, Hashimi p1 2.

, :

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets

- .csproj , (. - , , ).

( , - !)

+1

Code Contract, .
, TeamCity...

msbuild Microsoft Research (. . 44)

+1

Source: https://habr.com/ru/post/1761261/


All Articles