-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Error CS8032 An instance of analyzer System.Text.Json.SourceGeneration.JsonSourceGenerator cannot be created from (...) #56738
Comments
I believe if you want to use .Net 6, you need VS 2022. The error message is trying to tell you that: .Net 6 requires Roslyn version 4.0 and VS 2019 does not support that. |
Thanks @svick. I suspect you're correct - though I have been using .NET 6.0.100-preview.4 and prior versions with VS2019 without issues, so it seems support for VS2019 has been dropped in more recent releases. If you or anyone reading this know of any official announcement that .NET 6 requires VS2022 to work, please post here as I'm sure others will also expect .NET 6 to work with VS2019. It would also be great if a check could be added, with a clear message that VS2019 is not supported. |
Both the download page for .Net 6 RC1 and its release notes say that only VS 2022 is supported. It seems preview 4 was the last version to support VS 2019. |
There's also a recent change in dotnet/runtime to have the source generators multi-target for different Visual Studio versions: dotnet/runtime#59074 |
Closing the issue as by-design. Thanks |
Yes, it does not support VS2019. |
Warning
CS8032
System.Text.Json.SourceGeneration.JsonSourceGenerator cannot be created from ... when building a class library targetingnet6.0
with .NET 6 RC1 SDK:0Version Used:
SDK: 6.0.100-rc.1.21458.32
VS: 16.11.3
Steps to Reproduce:
Expected Behavior:
No warnings or errors
Actual Behavior:
Workaround:
Disable the warning
CS8032
:The text was updated successfully, but these errors were encountered: