Convert mpc and msbuild task package to a roslyn source generator#1599
Merged
Convert mpc and msbuild task package to a roslyn source generator#1599
Conversation
- remove project dependency - update dependency package version
The source generator will altogether deprecate this.
It presumably should be 3.8, but it doesn't compile with 3.8 at this point.
This will help with cacheability.
Contributor
|
Regarding CS8632 in Unity, it is necessary to write in the configuration file. |
…e-setting Set nullable in unity
Collaborator
Author
|
I have unity installed and it looks like the source generator broke somewhere along the way. Probably when I added the dependency from the source generator to the analyzer project. I'm looking into it now. |
This is important for dependency reasons, since code fixes bring in more dependencies than analyzers, and `dotnet build` and unity don't contain the dependencies required for code fixes.
Collaborator
Author
|
I fixed the build issues in unity it seems, but the analyzer and source generator no longer work at all (no errors, no warnings, no code gen). I had them working a while back, so I guess I broke something. Any ideas, @Y-YoL? |
Collaborator
Author
|
Downgrading the System.Text.Json dependency to 5.0.0 gets the analyzer and source generator to work. |
This was referenced Dec 2, 2025
This was referenced Jan 28, 2026
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.
This completely replaces mpc and the msbuild task package with a C# roslyn Source Generator.
NuGet package impact:
MessagePack.MSBuild.TasksMessagePack.SourceGeneratorMessagePack.Generatormpc. Unity users should now consume the source generator contained in theMessagePack.SourceGenerator.Unity.zipfile.MessagePack.SourceGeneratorMessagePack.SourceGenerator.Unity.zipIdeas for future work (after this PR)
[MessagePackFormatter]attribute on each[MessagePackObject](provided the class is declared aspartial) so that the default in-library resolvers will find the source generated formatter.MessagePackFormatterAttributederives fromIMessagePackFormatter<T>is only performed for one possible place where the attribute can appear instead of everywhere it may appear. Field and property searches are also repeated in many places, again with inconsistent code handling them.Remaining tasks
FullModeltype hierarchy has functional equality comparers.Compile Removeitems in the source generator test projects.Closes #1495