-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Don't forget about JsonSerializerOptions.CreateForWeb() #34626
Comments
This is one we only plan to do for 5.0, correct? (not in the blazor release) |
As per our early discussions, yes, this only applies for .NET 5, on the code for 3.1 we define the options directly in the Http.Json project as is done in ASP.NET. |
namespace System.Text.Json
{
public enum JsonSerializerDefaults
{
General,
Web
}
public partial class JsonSerializerOptions
{
public JsonSerializerOptions(JsonSerializerDefaults defaults);
}
} |
@layomia @terrajobst I want to work on this , I am new contributor hence may be I need your help to getting started and contribute first time in .net . what i understood is i have to create overloaded ctor with enum argument . is it ok and should i go ahead ? |
@jaymin93 thanks for your interest! Please see https://github.com/dotnet/runtime/tree/master/docs/workflow/building/libraries for steps on how to build the repo and run the tests.
Yes, this is right. The implementation for this will add new public API. Please see this recent JSON PR that adds new API as an example - #34725. Please let me know if you run into any issues. |
@layomia from above your mentioned pull request i can see already implemented parameterized constructor so this need to add as paste here in this issue then ? i am quite new here so please guide me if i am wrong at any place |
@jaymin93, not exactly. You need to add a new constructor & |
That part I understood but after adding ctor and parameter, what I have to do with parameter of constructor? I have to call base constructor as well from my new constructor??? |
ok got it let me go ahead with this , thanks for your help :) |
@rynowak @pranavkm does this satisfy your (ASP.NET) scenario? |
@layomia after executing build steps for libs of Json , i am not able to open in vs and cmd shows this error on my 2 computer , although i can see that it has started to install preview of 5.0.100-preview.4.20202.8 and without any error it builds but later executing it shows that it does not have preview sdk with below error message A compatible installed .NET Core SDK for global.json version [5.0.100-preview.4.20202.8] from [G:\sdk\New\runtime\global.json] was not found even i am facing issues currently i want to complete this task .if you can help me what i can do here ? |
You can use the dotnet that is downloaded in the .dotnet folder. Eg: |
Yes I can see it has downloaded and exist on path you mentioned but visual studio shows error when I open solution and further if I change version in global json then it shows error in code so what should I do here ? one more question do you mean this downloaded preview sdk i can use in visual studio without error ? if so please suggest how to do that ? |
can you please guide further ? @layomia @terrajobst can you also help here please ?
|
If you're just building from the commandline, use the dotnet.exe that I suggested. That should work using the steps you previously tried here: #34626 (comment) Check out the contributing doc for more information: https://github.com/dotnet/runtime/blob/master/docs/workflow/README.md Specifically:
You can also use /cc @ViktorHofer |
This is a leftover from #32937, we didn't add the default options that are meant to sync the options between
System.Net.Http.Json
and ASP.NET.As per the spec, the next API should be added as well.
Above method should return an options instance as the following:
The text was updated successfully, but these errors were encountered: