-
Notifications
You must be signed in to change notification settings - Fork 10k
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
MVC apps no longer work with PublishTrimmed #49360
Comments
The goal is to ensure this still works for the legacy |
You get this error whether you set TrimMode to partial or full. The issue is that when JsonSerializerIsReflectionEnabledByDefault= One way to fix this is before we call MakeReadOnly on the JsonSerializerOptions, check if the TypeInfoResolver is still |
This also affects the
I've taken a stab at this approach in #49393. @eiriktsarpalis What are your thoughts on how we should approach this? |
Is there an existing issue for this?
Describe the bug
Using an MVC app with PublishTrimmed no longer works. The same app worked in .NET 7.
This appears to be caused by the JsonSerializerIsReflectionEnabledByDefault changes. See dotnet/runtime#84378.
FYI @eiriktsarpalis
Expected Behavior
The app should work.
Steps To Reproduce
dotnet new mvc
<PublishTrimmed>true</PublishTrimmed>
to the csprojdotnet run
Exceptions (if any)
.NET Version
8.0.100-preview.7.23360.2
Anything else?
No response
The text was updated successfully, but these errors were encountered: