aspnet / Announcements

Subscribe to this repo to be notified about major changes in ASP.NET Core and Entity Framework Core
Other
1.66k stars 80 forks source link

JsonResult has moved to the Microsoft.AspNetCore.Mvc.Core assembly #389

Open rynowak opened 5 years ago

rynowak commented 5 years ago

JsonResult has moved to the Microsoft.AspNetCore.Mvc.Core assembly

JsonResult has moved to the Microsoft.AspNetCore.Mvc.Core assembly. This type used to be defined in Microsoft.AspNetCore.Mvc.Formatters.Json. While we have added [TypeForward(...)] that will address this issue for the majority of users, applications that use 3rd party libraries may encounter issues.

Libraries that were compiled against the 2.2 version of Microsoft.AspNetCore.Mvc.Formatters.Json may need to recompile in order to address the problem for all user.

Version introduced

3.0-preview 6

Old behavior

Application using a 2.2-based library could be built.

New behavior

Application fails compilation with an error like:

The type 'JsonResult' exists in both 'Microsoft.AspNetCore.Mvc.Core, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' and 'Microsoft.AspNetCore.Mvc.Formatters.Json, Version=2.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'

Reason for change

This is part of platform-level changes to the composition of ASP.NET Core as described here: https://github.com/aspnet/Announcements/issues/325

Recommended action

Contact the library author and ask them to recompile the library targeting ASP.NET Core 3.0.

Category

ASP.NET

Affected APIs

JsonResult

Issue metadata

rynowak commented 5 years ago

Please use https://github.com/aspnet/AspNetCore/issues/14176 for discussion of this topic.

This change occurred a while ago (preview-6). We're calling it out separately to make this problem easier to find.