How do I set Json.NET as default serializer in asp.net core 3.1 - asp.net-core-3.1

Converting an ASP.NET core 2.1 web app to 3.1 and found out a few endpoints broken because the new Json serializer works differently than Json.NET which is default in core 2.1.
I don't want to fix all my model class and want to set Json.NET as the default serializer..how do I do that?

refined my google search and it has been answered here:
https://stackoverflow.com/a/57652537/192727
I followed exactly what #Tao Zhou suggested and it did the trick.

Related

INodeServices is obsolete: Use Microsoft.AspNetCore.SpaServices.Extensions

We've recently upgraded from ASP.NET Core 1.0 to 3.1.
And in our code we're using the interface INodeServices and call its InvokeAsync method to activate some JavaScript library. After the upgrade to Core 3.1 the compiler complains that INodeServices is obsolete and should be replaced with 'Microsoft.AspNetCore.SpaServices.Extensions', but I couldn't find any type within this library that I could use instead of INodeServices, and I also coudn't find any documentation about it. What is the replacement for INodeServices.InvokeAsync in ASP.NET Core 3.1?
Thanks,
ashilon
Consider using this library instead https://github.com/JeringTech/Javascript.NodeJS
For more detailed informations and to see what other people did, i suggest you give a look at this thread https://github.com/dotnet/AspNetCore/issues/12890

_CookieConsentPartial.cshtml not found in asp.net core 3.0

I am using asp.net core 3.0.But in my application i couldn't find the file called _CookieConsentPartial.cshtml.
I am unable to find the file under presentation layer/views/shared.Can any one help me to find the file..
Thanks in Advance...
Cookie consent has been removed from the templates in ASP.NET Core 3.0, you can refer to below article to enable the default cookie consent feature like that found in the ASP.NET Core 2.2 templates :
https://learn.microsoft.com/en-us/aspnet/core/security/gdpr?view=aspnetcore-3.1

ASP.NET Dynamic Data Entities Web Project Broken

Can anybody get ASP.NET Dynamic Data Entities Web project working under EF 6.0.2 and .NET 4.5 in Visual Studio 2013?
I find problems in ManyToMany_Edit.ascx.cs and Global.asax.cs all relating to the switch in namespace for ObjectContext. Changing the using statements in the generated files is not enough. In other words, following this guide is not enough.
System.Web.DynamicData.dll doesn't seem to be aware of System.Data.Entity.Core.Objects.ObjectContext.
Have you read this post? http://blogs.msdn.com/b/webdev/archive/2014/02/28/announcing-the-release-of-dynamic-data-provider-and-entitydatasource-control-for-entity-framework-6.aspx , this works for me

What's the .NET 4.5 equivalent to UserNameWSTrustBinding?

I am converting a active profile STS to the new .NET 4.5 System.IdentityModel framework. My code using the UserNameWSTrustBinding which doesn't seem to exist in the new framework. Any suggestions.
Although this is an old question, I couldn't find any non-third-party answer on the internet, so here it is:
To replace UserNameWSTrustBinding in .NET 4.5, use the following:
var binding = new WS2007HttpBinding(SecurityMode.{what it was before});
binding.Security.Message.ClientCredentialType = MessageCredentialType.UserName;
I ported the WCF bindings to thinktecture identity model:
https://github.com/thinktecture/Thinktecture.IdentityModel.45
I also had a hard time finding something that for .NET 4.5 that was not a third party library. But I came across this link for code you can include in your project.

Listen for EDMX conversion?

When re-targeting a project from .NET 4.0 to .NET 4.5 in VS2012 any EDMX in the project is automatically converted to EF 5, i.e., the namespaces are updated to match the target framework.
Is there a way, maybe via an extension to the EDM Tools, to "listen" for this conversion? We use custom annotations in the EDMX, and when the upgrade is performed also need to convert/update our annotations.
We currently implement IModelTransformExtension to perform custom logic when the model is loaded and saved, and in theory we can use the OnAfterModelLoaded to do the conversion of the annotations too, but since the conversion is needed one time only, and always specifically when the .NET framework is retargeted, it would be great if there's another option.
Any ideas?