You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.
By manually adding imports and msbuild properties (b/c no IDE support in VS 2017), ccrewrite works on netcoreapp and netstandard projects (only when portable PDBs are not used).
Running the build using msbuild /t:build works. Running the build using dotnet build fails:
dotnet build /v:normal
Build started 2017-09-25 9:06:34 AM
...
CreateCodeContractReferenceAssembly:
"C:\Program Files (x86)\Microsoft\Contracts\Bin\ccrefgen.exe" "@obj\Debug\netstandard2.0\MyProject.ccrefgen.rsp"
elapsed time: 881.9998ms
CodeContractRewrite:
"C:\Program Files (x86)\Microsoft\Contracts\Bin\ccrewrite.exe" "@MyProject.ccrewrite.rsp"
There were errors reported in Tv.Web.Upfront.Model's metadata.
Exception of type 'System.OutOfMemoryException' was thrown.
1>ccrewrite : error : Foxtrot: There were errors reported in Tv.Web.Upfront.Model's metadata. [C:\src\my\project\MyProject.csproj]
Exception of type 'System.OutOfMemoryException' was thrown.
elapsed time: 61.4774ms
1>C:\Program Files (x86)\Microsoft\Contracts\MsBuild\v15.0\Microsoft.CodeContracts.targets(275,5): error MSB3073: The command ""C:\Program Files (x86)\Microsoft\Contracts\Bin\ccrewrite.exe" "@MyProject.ccrewrite.rsp"" exited with code -1. [C:\src\my\project\MyProject.csproj]
1>Done Building Project "C:\src\my\project\MyProject.csproj" (Build target(s)) -- FAILED.
Build FAILED.
Disable sn.exe in VS 2017 code contracts targets, to allow code contracts to build within "dotnet build" or "dotnet test".
.NET core does not support sn.exe nor `GetFrameworkSdkPath`
By manually adding imports and msbuild properties (b/c no IDE support in VS 2017), ccrewrite works on netcoreapp and netstandard projects (only when portable PDBs are not used).
Running the build using
msbuild /t:build
works. Running the build usingdotnet build
fails:The root cause is this block of the
Microsoft.CodeContracts.targets
file:https://github.com/Microsoft/CodeContracts/blob/master/Microsoft.Research/ManagedContract.Setup/MSBuild/v15.0/Microsoft.CodeContracts.targets#L292
Target
GetFrameworkSdkPath
, andsn.exe
don't exist in the dotnet build system.The text was updated successfully, but these errors were encountered: