-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Add Try methods to JsonObject #111229
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
Add Try methods to JsonObject #111229
Conversation
@dotnet-policy-service agree |
@eiriktsarpalis Sorry to trouble you, I would have written some tests, but at the moment I seem not to be able to run any. I followed the testing guide here: docs/workflow/testing/libraries/testing.md Neither |
Don't use the global |
@huoyaoyuan then how can I debug in Visual Studio if I need to use dotnet.cmd? Also, for example, if I needed to execute the tests in |
@Flu You can use the
That should make it possible to run tests from the test explorer as normal. |
@eiriktsarpalis I am now getting this error when trying to run the tests from inside visual studio after I've used your command:
This has nothing to do with my changes, as it's happening on the main branch as well, most recent commit. |
@Flu did you try building the full runtime+libraries first?
|
@eiriktsarpalis Yes. I mean, I am adding test.libs as well:
This is the exact command I've been using. Removing the |
And that step is building successfully? |
Yes |
@ViktorHofer any ideas what might be missing? |
Yes, it looks like APICompat is currently broken on desktop msbuild (which is used inside VS): dotnet/sdk#45004 |
You shouldn't need to disable ApiCompat to get your dev environment set up though. I would recommend stashing your changes, then build the repo, make sure that tests run from the IDE, and finally pop your changes back in. |
I've been having this issue as well. The workaround that I use is to run the tests from VS test explorer but when the build fails and VS shows the failure dialog, select "Yes" to run tests from last successful build. Everything (e.g. debugging, breakpoints, etc.) works as expected since the API compat step of the build (which is component that is failing) seems to be after the product and test binaries are already generated.
You should be able to use |
@PranavSenthilnathan Thank you, it finally worked. Clever solution! |
@eiriktsarpalis I'm ready for a review |
src/libraries/System.Text.Json/src/System/Text/Json/Nodes/JsonObject.IDictionary.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Text.Json/src/System/Text/Json/Nodes/JsonObject.IDictionary.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Text.Json/src/System/Text/Json/Nodes/JsonObject.IDictionary.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Text.Json/src/System/Text/Json/Nodes/JsonObject.IDictionary.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Text.Json/src/System/Text/Json/Nodes/JsonObject.cs
Outdated
Show resolved
Hide resolved
|
As per the API proposed in #110244, the following functions have been added to
JsonObject
:This resolves #110244