microsoft / CodeContracts

Source code for the CodeContracts tools for .NET
Other
882 stars 150 forks source link

Rewrite aborted on System.Runtime.CompilerServices.ExtensionAttribute #245

Open k59319 opened 9 years ago

k59319 commented 9 years ago

I can't build my project after updating SharePoint Online CSOM through Nuget. Build fails on ccrewrite with the following error.

Reading assembly 'Microsoft.SharePoint.Client.Runtime' from ...\packages\Microsoft.SharePointOnline.CSOM.16.1.3912.1204\lib\net40-full\Microsoft.SharePoint.Client.Runtime.dll' resulted in errors. Could not resolve type reference: [mscorlib]System.Runtime.CompilerServices.ExtensionAttribute. Could not resolve member reference: System.Runtime.CompilerServices.ExtensionAttribute::.ctor. ccrewrite : error : Rewrite aborted due to metadata errors. Check output window

I use Code Contracts extension v.1.9.10714.2 and Visual Studio 2015.

SergeyTeplyakov commented 8 years ago

Sorry for the late reply, but can you provide content from the output window?

This issue could be related to #340, but I would like to be sure.

k59319 commented 8 years ago

It doesn't have any specific tab in the output window.

1>------ Rebuild All started: Project: Common, Configuration: Debug Any CPU ------
1>  elapsed time: 1615,0429ms
1>  Common -> C:\...\Dev\Common\bin\Debug\HarePoint.WorkflowMigrator.Common.dll
2>------ Rebuild All started: Project: WorkflowManagement, Configuration: Debug Any CPU ------
2>  elapsed time: 2872,0634ms
2>  Reading assembly 'Microsoft.SharePoint.Client.Runtime' from 'C:\...\OnlineCsom\Microsoft.SharePoint.Client.Runtime.dll' resulted in errors.
2>      Could not resolve type reference: [mscorlib]System.Runtime.CompilerServices.ExtensionAttribute.
2>      Could not resolve member reference: System.Runtime.CompilerServices.ExtensionAttribute::.ctor.
2>ccrewrite : error : Rewrite aborted due to metadata errors. Check output window
2>  elapsed time: 1844,1887ms
2>C:\Program Files (x86)\Microsoft\Contracts\MsBuild\v14.0\Microsoft.CodeContracts.targets(265,5): error MSB3073: The command ""C:\Program Files (x86)\Microsoft\Contracts\Bin\ccrewrite.exe" "@WorkflowManagementccrewrite.rsp"" exited with code -1.
========== Rebuild All: 1 succeeded, 1 failed, 0 skipped ==========
SergeyTeplyakov commented 8 years ago

This new message already has additional information. The error is: Could not resolve type reference....

Some bug fixes with very similar behavior were already fixed.

I'm going to create new beta release tomorrow, so I would ask you to test the same code with latest version of ccrewrite.

k59319 commented 8 years ago

Installed v.1.10.10126.2-rc1, the issue still remains:

1>  Reading assembly 'Microsoft.SharePoint.Client.Runtime' from 'C:\...\Microsoft.SharePoint.Client.Runtime.dll' resulted in errors.
1>      Could not resolve type reference: [mscorlib]System.Runtime.CompilerServices.ExtensionAttribute.
1>      Could not resolve member reference: System.Runtime.CompilerServices.ExtensionAttribute::.ctor.
1>ccrewrite : error : Rewrite aborted due to metadata errors. Check output window
1>  elapsed time: 3691,3747ms
1>C:\Program Files (x86)\Microsoft\Contracts\MsBuild\v14.0\Microsoft.CodeContracts.targets(265,5): error MSB3073: The command ""C:\Program Files (x86)\Microsoft\Contracts\Bin\ccrewrite.exe" "@WorkflowManagementccrewrite.rsp"" exited with code -1.
========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped ==========