Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Crossgen2 should emit a warning or error when two different versions of the same assembly are referenced #114513

New issue

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

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

Already on GitHub? Sign in to your account

Open
MarkOsborneMS opened this issue Apr 10, 2025 · 0 comments

Comments

@MarkOsborneMS
Copy link

Description

When updating Roslyn to use version 9 of the .NET libraries build authoring was accidentally updated to reference two different versions of System.Reflection.Metadata.dll this resulting in an assembly being generated that produced an unexpected MissingMethod exception - it took us a while to work out that crossgen we the source of the issue.

It would be nice if crossgen emitted a warning or error message so that this mistake could be caught at build time.

Reproduction Steps

Call crossgen2 with the same assembly referenced twice with different versions.

e.g.

--reference:Q:\.tools\.nuget\packages\microsoft.netcore.app.runtime.win-x64\8.0.13\runtimes\win-x64\lib\net8.0\System.Reflection.Metadata.dll
--reference:C:\Users\gel\roslyn\artifacts\bin\Microsoft.CodeAnalysis.Remote.ServiceHub.CoreComponents.x64\Debug\net8.0\publish\CrossGen\OriginalAssemblies\System.Reflection.Metadata.dll

Expected behavior

An error or warning

Actual behavior

An assembly is created that generates an unexpected MissingMethod exception

Regression?

No response

Known Workarounds

No response

Configuration

Windows, x64
crossgen2 version 8.0.13

Other information

No response

@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Apr 10, 2025
@steveisok steveisok added this to the 10.0.0 milestone Apr 11, 2025
@steveisok steveisok removed the untriaged New issue has not been triaged by the area owner label Apr 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants