Skip to content
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

Remove missing MVID warning on XAML compilation #14014

Merged
merged 1 commit into from Dec 22, 2023

Conversation

MrJul
Copy link
Member

@MrJul MrJul commented Dec 21, 2023

What does the pull request do?

This PR removes the annoying "Could not extract the MVID from "obj\path\refint\assembly.dll". Are you sure it is a reference assembly?" warning affecting builds using the XAML compiler.

While completely harmless, people often think it's a build failure, and the warning can't be easily removed.

How was the solution implemented (if it's not obvious)?

As commented in the modified .targets file:

Deletes the target ref assembly before the CopyRefAssembly task (in target CopyFilesToOutputDirectory) tries to access it.

CopyRefAssembly reads the ref assembly's MVID from the .mvid PE section to avoid copying if necessary.
However, Cecil doesn't preserve that PE section: this results in a warning.
By deleting the file beforehand, we're preventing the warning.
There are no changes in behavior since CopyRefAssembly always copy the file if it couldn't read the MVID.

References:

Fixed issues

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.1.999-cibuild0043092-beta. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@maxkatz6 maxkatz6 added the backport-candidate-11.0.x Consider this PR for backporting to 11.0 branch label Dec 22, 2023
@maxkatz6 maxkatz6 added this pull request to the merge queue Dec 22, 2023
Merged via the queue into AvaloniaUI:master with commit 75e7c8d Dec 22, 2023
6 checks passed
@maxkatz6 maxkatz6 added backported-11.0.x and removed backport-candidate-11.0.x Consider this PR for backporting to 11.0 branch labels Jan 17, 2024
maxkatz6 pushed a commit that referenced this pull request Jan 17, 2024
#Conflicts:
#	packages/Avalonia/AvaloniaBuildTasks.targets
@MrJul MrJul deleted the fix/mvid-warning branch February 29, 2024 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ref-assembly related warning from CompileXaml task
4 participants