Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

The Mono.Cecil version in the Microsoft.NET.ILLink NuGet is wrong #2173

Closed
rolfbjarne opened this issue Jul 27, 2021 · 1 comment · Fixed by #2174
Closed

The Mono.Cecil version in the Microsoft.NET.ILLink NuGet is wrong #2173

rolfbjarne opened this issue Jul 27, 2021 · 1 comment · Fixed by #2174

Comments

@rolfbjarne
Copy link
Member

NuGet: Microsoft.NET.ILLink v6.0.100-preview.6.21376.2.

The nuspec references Mono.Cecil 0.11.3:

$ cat /Users/rolf/.nuget/packages/microsoft.net.illink/6.0.100-preview.6.21376.2/microsoft.net.illink.nuspec | grep Mono.Cecil
        <dependency id="Mono.Cecil" version="0.11.3" exclude="Build,Analyzers" />

While the illink.dll wants Mono.Cecil 0.11.4:

 $ monodis --assemblyref /Users/rolf/.nuget/packages/microsoft.net.illink/6.0.100-preview.6.21376.2/ref/net5.0/illink.dll
AssemblyRef Table
1: Version=5.0.0.0
	Name=System.Runtime
	Flags=0x00000000
	Public Key:
0x00000000: B0 3F 5F 7F 11 D5 0A 3A 
	Zero sized hash value
2: Version=0.11.4.0
	Name=Mono.Cecil
	Flags=0x00000000
	Public Key:
0x00000000: 50 CE BF 1C CE B9 D0 5E 
	Zero sized hash value

The end result is that if I reference the Microsoft.NET.ILink package, I end up with this build problem:

CSC [dotnet] dotnet-linker.dll
CSC : error CS1705: Assembly 'illink' with identity 'illink, Version=6.0.100.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' uses 'Mono.Cecil, Version=0.11.4.0, Culture=neutral, PublicKeyToken=50cebf1cceb9d05e' which has a higher version than referenced assembly 'Mono.Cecil' with identity 'Mono.Cecil, Version=0.11.3.0, Culture=neutral, PublicKeyToken=50cebf1cceb9d05e'

because the build ends up referencing Mono.Cecil 0.11.3

Sample build log: msbuild.binlog.zip

CC @marek-safar

@rolfbjarne rolfbjarne changed the title The Mono.Cecil reference in Microsoft.NET.ILLink is wrong The Mono.Cecil version in the Microsoft.NET.ILLink NuGet is wrong Jul 27, 2021
@rolfbjarne
Copy link
Member Author

A workaround is to add a reference Mono.Cecil 0.11.4 in my project:

<ProjectReference Include="Mono.Cecil" Version="0.11.4" />

and that seems to make the build choose the correct version.

rolfbjarne added a commit to dotnet/macios that referenced this issue Jul 27, 2021
sbomer added a commit to sbomer/linker that referenced this issue Jul 27, 2021
The submodule update in dotnet#2156
incremented the cecil version, but we were still using 0.11.3 as the version
in our package graph. See dotnet#1515 for more
context on how this is set up.

Fixes dotnet#2173
rolfbjarne added a commit to dotnet/macios that referenced this issue Jul 28, 2021
* Update dependencies from https://github.com/dotnet/installer build 20210727.4

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.100-rc.1.21376.3 -> To Version 6.0.100-rc.1.21377.4

Dependency coherency updates

Microsoft.NET.ILLink.Tasks
 From Version 6.0.100-preview.6.21370.1 -> To Version 6.0.100-preview.6.21376.2 (parent: Microsoft.Dotnet.Sdk.Internal

* Bump Mono.Cecil from 0.11.3 to 0.11.4.

* [dotnet-linker] Reference Mono.Cecil 0.11.4 directly.

Works around dotnet/linker#2173.

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
sbomer added a commit that referenced this issue Jul 28, 2021
* Bump cecil package version

The submodule update in #2156
incremented the cecil version, but we were still using 0.11.3 as the version
in our package graph. See #1515 for more
context on how this is set up.

Fixes #2173

* Remove unnecessary cast
agocke pushed a commit to dotnet/runtime that referenced this issue Nov 16, 2022
* Bump cecil package version

The submodule update in dotnet/linker#2156
incremented the cecil version, but we were still using 0.11.3 as the version
in our package graph. See dotnet/linker#1515 for more
context on how this is set up.

Fixes dotnet/linker#2173

* Remove unnecessary cast

Commit migrated from dotnet/linker@0cb9250
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant