When I'm migrating the .net core application from 2.0 to 3.1, the following method services.AddCookieTempData() is not working since it's referring assembly"AspNetCore.Mvc.CookieTempData". If we comment this code it's showing the below error message. Please let us know what is the alternate for this method.
public void ConfigureServices(IServiceCollection services) { services.AddCookieTempData();
Error Message: The 'Microsoft.AspNetCore.Mvc.ViewFeatures.Infrastructure.DefaultTempDataSerializer' cannot serialize an object of type