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

Avoid BuildHost crash in Mono due to missing types #74994

Merged
merged 1 commit into from
Sep 5, 2024

Conversation

jaredpar
Copy link
Member

@jaredpar jaredpar commented Sep 4, 2024

The LoadProjectFileAsync routine calls EnsureMSBuildLoaded to make sure the Microsoft.Build.dll is accessible, but requires types from that assembly within the routine itself. This may not always work with Mono, as the JIT may look up the types during compilation.

Fixed by splitting out a LoadProjectFileCoreAsync routine, similarly to what is already done for GetProjectsInSolution.

Fixes dotnet/runtime#101121.

The LoadProjectFileAsync routine calls EnsureMSBuildLoaded to make
sure the Microsoft.Build.dll is accessible, but requires types from
that assembly within the routine itself.  This may not always work
with Mono, as the JIT may look up the types during compilation.

Fixed by splitting out a LoadProjectFileCoreAsync routine, similarly
to what is already done for GetProjectsInSolution.

Fixes dotnet/runtime#101121.
@jaredpar jaredpar requested a review from a team as a code owner September 4, 2024 23:16
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Sep 4, 2024
@jaredpar jaredpar merged commit 9f86520 into dotnet:main Sep 5, 2024
25 checks passed
@jaredpar jaredpar deleted the buildhost-mono-types branch September 5, 2024 02:08
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Sep 5, 2024
@uweigand
Copy link
Contributor

uweigand commented Sep 5, 2024

Thanks, @jaredpar ! Can this still make it into .NET 9?

@jaredpar
Copy link
Member Author

jaredpar commented Sep 5, 2024

Yes it will make .NET 9. Our main branch is still flowing there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead VSCode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dotnet build hangs while building libs.tests natively using cross built dotnet sdk
4 participants