Skip to content

Conversation

@pCYSl5EDgo
Copy link
Contributor

@pCYSl5EDgo pCYSl5EDgo commented Jan 10, 2024

TargetFramework Changes

  • net6.0 -> net6.0 and net8.0
  • Single net7.0 -> net8.0

Code Fixes

LangVersion

If TargetFramework is net8.0 then LangVersion is 12 else as-is.

@pCYSl5EDgo pCYSl5EDgo mentioned this pull request Jan 10, 2024
14 tasks
@pCYSl5EDgo pCYSl5EDgo changed the title .Net 8 Update: TargetFrameworks .Net 8 Update(2): TargetFrameworks Jan 10, 2024
@pCYSl5EDgo pCYSl5EDgo closed this Jan 10, 2024
@pCYSl5EDgo pCYSl5EDgo reopened this Jan 10, 2024
@pCYSl5EDgo
Copy link
Contributor Author

pCYSl5EDgo commented Jan 10, 2024

I can build the solution and all tests are passed in dotnet CLI.
But in Visual Studio 17.8.4, the build process fails at MessagePack.GeneratedCode.Tests (Edit: Sorry, not at but related to sandbox/SharedData.)
What is happening in Visual Studio?

Copy link
Collaborator

@AArnott AArnott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on these changes. They all look good.

in Visual Studio 17.8.4, the build process fails at sandbox/SharedData.

I'm not seeing the failure in that project. But I do see a build failure in MessagePack.GeneratedCode.Tests when it runs from visual studio (CLI is fine, as you say). I'll look into this and loop in the roslyn team if I suspect a compiler bug.

Copy link
Collaborator

@AArnott AArnott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One link of the chain that explains why build in VS fails is that the GeneratedMessagePackResolver type in Sandbox and SharedData is being generated as internal instead of public, making it inaccessible to the MessagePack.GeneratedCode.Tests project.

A MessagePackAnalyzer.json file for each of these projects specify that this resolver should be produced publicly. And indeed, dotnet build honors this. But the VS build doesn't.
I'll keep investigating.

AArnott

This comment was marked as duplicate.

@pCYSl5EDgo
Copy link
Contributor Author

Thank you for your investigating.
Oh... They are generated as internal... I missed it.

Copy link
Collaborator

@AArnott AArnott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found the problem. Our in-solution .props file for activating the source generator is missing a few dependencies, causing the in-VS build to fail to deserialize the json file, and when it fails to do that, it just swallows it and proceeds with default behavior. Not great on multiple levels. I'm preparing a fix now.

@AArnott AArnott enabled auto-merge January 10, 2024 15:46
@pCYSl5EDgo
Copy link
Contributor Author

Thank you!

Copy link
Collaborator

@AArnott AArnott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much for preparing these changes!

@AArnott AArnott merged commit 3245308 into MessagePack-CSharp:develop Jan 10, 2024
@pCYSl5EDgo pCYSl5EDgo deleted the net8-targetframeworks branch January 10, 2024 16:02
@AArnott AArnott added this to the v2.6 milestone Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants