Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a MissingMethodException in MSBuildEventSource that was introduced by a previous change (PR #12886) that attempted to use the .NET runtime's EventSource source generator. The source generator was calling an internal EventSource constructor that is not available in the public API, causing runtime failures when MSBuild is used with .NET 10.
Changes:
- Removed the
partialkeyword fromMSBuildEventSourceclass declaration - Added an explicit private parameterless constructor to restore the original functionality
Member
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
YuliiaKovalova
approved these changes
Jan 19, 2026
This was referenced Jan 20, 2026
This was referenced Mar 11, 2026
Closed
This was referenced Mar 13, 2026
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I'm seeing this exception:
In ILSpy I see Microsoft.Build.Framework.dll
18.3.0-preview-26055-101+e64f84d6312cdaf227d26aeabfa4817862404d59having:But in
C:\Program Files\dotnet\shared\Microsoft.NETCore.App\10.0.1\System.Private.CoreLib.dll(loaded in .NET 10) I see:It's both internal and the args are backwards...
I believe this was introduced in #12886.
Which pulls in this change: dotnet/runtime#121180
That seems to introduce a source generator which calls the internal ctor of EventSource (and with different order). As that's internal to .NET, I expect it was not intended to be applied here in MSBuild.
This change simply reverts the change to
MSBuildEventSource.