-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
Missing type forward for JsonResult in ASP.NET Core 3.0? #7220
Comments
Presumably due to this breaking change: aspnet/Announcements#325 I don't think a type forwarder can be use because I thought they could be used only when the type moved to an assembly referenced from the original assembly. In this case clearly that can't happen because the whole idea was to move |
So JsonResult used to be in Microsoft.AspNetCore.Mvc.Formatters.Json and it moved to Microsoft.AspNetCore.Mvc.Core but one of the constructors changed shape as well so it's not binary compatible. Maybe we can do a TypeForwardedFrom on the new type to fix this compile error but I'm not sure if it'll work after that. We should see play around and see what we can do. |
I guess a way to make it a non-breaking compiler change would at least be good if it can't be a non-breaking binary change. |
@pranavkm, any suggestions? |
Type forwarding resolves this specific build error. There are other breaking changes with that specific package, but we expect using |
* Add a TypeForward for JsonResult Fixes #7220
@martincostello if you like testing our previews you can get a new build of .NET Core 3.0 with the SDK here https://github.com/dotnet/core-sdk#installers-and-binaries. |
@davidfowl Thanks, I'll try out an updated version with a fix today 👍 |
I've updated out application to SDK
|
Looks like that's actually a different issue, and that's a incompatibility in Swashbuckle.AspNetCore caused by the changes to remove Newtonsoft.Json from the core: |
Also posted as domaindrivendev/Swashbuckle.AspNetCore#1030
Describe the bug
If an ASP.NET Core 3.0 preview 2 application references Swashbuckle.AspNetCore
4.0.1
and uses theMicrosoft.AspNetCore.Mvc.JsonResult
anywhere in code, aCS0433
compiler error is generated and the application will not compile.To Reproduce
3.0.0-preview-19075-0444
.<PackageReference Include="Swashbuckle.AspNetCore" Version="4.0.1" />
ValuesController.cs
:public void Foo(int id) => new JsonResult(new { });
Expected behavior
The application compiles cleanly.
Additional context
The issue can be worked around by adding the following to the
.csproj
file of the project as referenced by NuGet/Home#4989 (comment):Output of
dotnet --info
:The text was updated successfully, but these errors were encountered: