Skip to content
This repository was archived by the owner on Sep 25, 2026. It is now read-only.
This repository was archived by the owner on Sep 25, 2026. It is now read-only.

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

Closed

Description

@rolfbjarne

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

Activity

  1. 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[/+] on Jul 27, 2021
  2. rolfbjarne commented on Jul 27, 2021

    @rolfbjarne
    MemberAuthor

    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.

  3. added a commit that references this issue on Jul 27, 2021
  4. added a commit that references this issue on Jul 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions