Commit Graph
39 Commits
Author SHA1 Message Date
Layomi Akinrinade 7b19ccefcc Enable property visibility tests in source-gen mode (#54526)
* Enable property visibility tests in source-gen mode

* Address feedback

* Fix S.N.H.Json tests

* Fix S.T.J tests

* Fix S.N.H.J tests ii
2021-07-12 21:11:25 -07:00
Steve Harter 8faef77665 Support synchronous Stream-based serialization methods (#54632) 2021-06-24 14:35:35 -05:00
Viktor Hofer 0377558d94 Include NetCoreAppCurrent configs in packages (#53439)
* Include NetCoreAppCurrent configs in packages

The NetCoreAppCurrent configurations were omitted from packages to avoid
ever growing packages. Now that we adhere to the support policy for
packages we don't need to exclude them anymore as the policy defines a
baseline for .NETCoreApp configurations.

This will remove an artificial difference when source building the
repository and also make it so that partner repositories which don't
depend on a transport package like windowsdesktop (winforms) receive
the very latest assets that are included in the shared framework as
well.

* Fix package validation for non exposed inbox libs
2021-06-08 23:36:01 +02:00
Eric Erhardt 95a4476b91 Remove DynamicallyAccessedMembers on JsonSerializer (#53235)
* Remove DynamicallyAccessedMembers on JsonSerializer

Fix #52268

* Remove DynamicallyAccessedMembers from System.Net.Http.Json

These are no longer required since System.Text.Json doesn't have these annotations anymore.

* Update PreviousNetCoreApp baseline for attribute removal

* Fix trimming tests on browser-wasm

* Fix Json tests on EnableAggressiveTrimming leg
2021-05-28 20:55:56 -05:00
Layomi Akinrinade 6e5f722a9d Add JSON source-gen mode that emits serialization logic (#53212)
* Add JSON source-gen mode that emits serialization logic

* Fix System.Net.Http.Json test issues

* Fix System.Text.Json test issues

* Make check to determine if fast-path can be used more efficient

* Address review feedback

* Improve derived-JsonSerializerContext detection and support

* Address review feedback; reenable tests, and simplify object metadata
init

* Fix formatting
2021-05-27 02:38:01 -04:00
Eric Erhardt 05a8c766b6 Move s_defaultSerializerOptions to JsonHelpers. (#52557)
This allows for JsonContent to be trimmed in a default Blazor WASM app.
2021-05-13 11:34:06 -05:00
Mitchell HwangandMitchell Hwang 720ee21578 [Android][libraries] Active issue remaining android failing tests (#52654)
* [Android][libraries] Add System.Net.Http.Json.Functional.Tests ActiveIssue

* [Android][libraries] Add System.Runtime.Caching.Tests ActiveIssue

Co-authored-by: Mitchell Hwang <[email protected]>
2021-05-12 14:49:27 -04:00
Vitek KarasandEric Erhardt d4fc640c49 Improve trimmer suppressions in async code (#52432)
Co-authored-by: Eric Erhardt <[email protected]>
2021-05-11 04:51:55 -07:00
Eric Erhardt c73ef4965d Resolve ILLink warnings in System.Text.Json (Round 1) (#51886)
* Resolve ILLink warnings in System.Text.Json (Round 1)

Also resolve ILLink warnings in System.Net.Http.Json.

Contributes to #45623

* PR feedback
2021-04-28 23:04:21 +00:00
Layomi Akinrinade edade17c28 Add Put/Post methods to HttpClientJsonExtensions that take type metadata (#51609)
* Add Put/Get methods to HttpClientJsonExtensions that take type metadata

* Make JsonContentOfT derive directly from HttpContent

* Fix linker error

* Rename Helper to JsonHelpers
2021-04-22 00:42:24 +00:00
Layomi Akinrinade 24966ab54e [JSON source gen 3/3] Add new methods to JsonSerializer and System.Net.Http.Json APIs that take type metadata (#51528)
* Add new methods to JsonSerializer and System.Net.Http.Json APIs that take type metadata

* Address review feedback
2021-04-20 22:45:26 +00:00
Jeremy Koritzinsky 4181533899 Use the .noRC2 cert variants in the System.Net tests when on a platform that does not support RC2. (#49461) 2021-03-11 14:02:56 -08:00
Viktor Hofer d77092decb Use live dependencies for netcoreapp3.0 depencies (#48176)
* Use live dependencies for netcoreapp3.0 deps
2021-02-16 12:24:23 +01:00
Viktor Hofer ceaa8ae8f7 Inline package descriptions and remove descriptions.json files across the repo (#46306)
* Support runtime package descriptions

* Update arcade Packaging pkg

* Inline pkg descriptions for coreclr

* Inline pkg descriptions for mono

* Inline pkg descriptions for installer

* Inline pkg descriptions for libraries
2020-12-22 16:07:56 +01:00
Viktor Hofer ed295782bf Add workflow to update solution files with SlnGen and update them initially (#44703)
* Add slngen infra

* Update all solution files
2020-11-17 18:23:30 +01:00
Anirudh Agnihotry 2db717954a Add a new net6.0 TargetFramework (#42709)
* upgrade to net6.0

* add comment and update package version

* address feedback and fix failures

* address feedbacl

* address feedback
2020-10-07 15:36:58 -07:00
Layomi Akinrinade 994dca6f34 Add granular suppressions for linker warnings (#40691)
* Add granular suppressions for linker warnings

* Add suppressions for mono SPC

* Misc additions

* Add suppressions for Debug config

* Fix Android xml file

* Include System.ComponentModel.Annotations suppressions

* Add suppressions for System.Security.Cryptography.X509Certificates on Linux

* Fix TargetOs exists check

* Add IL2077 to System.Security.Cryptography.X509Certificates on Android

* Generalize some System.Security.Cryptography.X509Certificates suppressions to 'NonWindows'

* Remove ref to catch-all System.Security.Cryptography.X509Certificates file

* Misc clean up and some feedback

* Use ILLinkDirectory in CreateRuntimeRootILLinkDescriptorFile.targets

* Update paths for directories

* Set TargetPath as part of include

* Delete bin-placing TODO

* Include more xml files during per-library run

* Include more xml files during per-library run, pt 2

* Include more xml files during per-library run, pt 3

* Try including System.ComponentModel.Annotations based on BuildingNETCoreAppVertical

* Switch to BuildAllConfigurations

* Include xml extension in file paths

* Remove version number from assembly suppression files

* Delete ILLink.Suppressions.xml

* Try removing IL2035 nowarn

* Remove version from Microsoft.VisualBasic.Core assemly name
2020-09-30 09:06:25 -05:00
Viktor Hofer 2182936365 Add transitive CompilerServices.Unsafe dependency (#41616)
* Add transitive CompilerServices.Unsafe dependency

for System.Memory and System.Threading.Tasks.Extensions package
references. Adding the dependency as a P2P to prefer the live asset
over the prebuilt.
2020-09-07 22:18:28 +02:00
Layomi Akinrinade dbacdc2acb Add JsonNumberHandling.AllowReadingFromString as a JsonSerializer web default (#41539)
* Add JsonNumberHandling.AllowReadingFromString as a JsonSerializer web default

* Add test assertion for number handling option in S.N.H.Json

* Test number-as-string behavior in System.Net.Http.Json
2020-09-03 14:16:13 -07:00
Jan Kotas 1789775d07 Update license headers (#41783) 2020-09-03 08:43:29 +00:00
Sergey Aseev a62b38d052 Move content type verification to a later stage (#40594)
* Move content type verification to a later stage

Fix #38713

* Rename ValidateContent to ValidateContentType

Fix #38713

* Get rid of content type check

* Add newline at end of the file

* Rename TestValidMediaTypes to TestVariousMediaTypes
2020-08-14 15:07:24 -07:00
Stephen Toub e7204f5d6f Use T? for unconstrained nullable types (#40197)
* Temporarily upgrade compiler version for T? support

* Use T? for unconstrained nullable types
2020-08-07 11:25:42 -04:00
Viktor Hofer 809a06f451 Remove depprojs in favor of PackageReferences (#35606)
- Remove depprojs which currently binplace external references into the RefPath folders in favor of PackageReference and PackageDownload items.
- Build all configurations by default when building an individual project (either on the CLI or inside VS) same as with the official SDK. This enables .NETFramework Test Explorer support.
- Centrally define libraries that compose the shared framework instead of in each Directory.Build.props file to be able to build the targeting pack first and consume it in the OOB libraries.
- Use ProjectReferences to reference OOB projects. Compile against the reference assembly but use the implementation assembly app-local during runtime.
- Remove OOBs from the testhost and remove the testhost folder for .NETFramework as it isn't required anymore.
- Only binplace for $(NetCoreAppCurrent) to compose a) the targeting pack, b) the runtime pack, c) the testhost, d) a full closure for the shims.
- Use Targeting Packs for OOB projects (with their implicit assembly references) but still explicitly define granular references for .NETCoreApp configurations (DisableImplicitAssemblyReferences switch). Use the implicit targeting pack references in some Microsoft.Extensions.* cases.
- Remove placeholder configurations as they aren't needed anymore with explicit P2Ps vs Targeting Pack references.
- Remove implicit assembly references (ie for .NETFramework, mscorlib)
- Remove AssemblySearchPath hacks that were introduced with b7c4cb7 as the targeting pack is now used by default.
- Reduce unnecessary .NETFramework configurations that were added to run tests in favor of the already existing ref&src configurations.
- Stop hardcoding the paths for wasm assemblies and use the returned TargetPath of the ProjectReferences.
- Addressed formatting (ItemGroups, References at the bottom of the project file, ordering of references, use LibrariesProjectRoot instead of a relative path, unnecessary AssemblyName and RootNamespace properties which are identical to the project name, ordering of tfms)
- Revert "fix clean (#33758)"
2020-07-23 17:20:26 +02:00
Carlos Sanchez Lopez 7f34be5319 Apply CA2016: Forward CancellationToken to methods that can take it (#37607)
* Forward CancellationToken to methods that can take it

* Address suggestions

* address suggestions

* Revert using

* Make rule 2016 a warning in runtime

* Extra cases found

* Revert changes that should not pass a token, change rule to info to verify build and test CI results

* Pass CancellationToken.None to base.CreateContentReadStreamAsync, as in its default overload

* Address stack overflow in MultipartContent

* HostingAbstractionsHostExtensions address using

* Update nuget package version to latest, Info->Warning again, fix one more case.

* System.Diagnostics.ProcessWaitState.Unix token

* Remove two unnecessary tokens
2020-07-15 13:10:46 -07:00
Jose Perez RodriguezandEric StJohn b7c4cb71fe Add NetFramework Configurations to OOB packages (#39099)
* Porting new netfx configurations for packages

* Add Netfx configurations to Microsoft.Extensions and missing System packages

* Making sure net461 configurations build against targeting pack assembly versions

* Undo changes to add netfx configurations on reference projects that don't ship in their package

* Fix issue with M.E.FP.P package by removing NetStandard.Library metapackage dependency

* Fix issues with depending on higher version than the one available in net461

* Disable UTF8String verifyClosure on package

* Undo changes to Microsoft.XmlSerializer.Generator

* Update src/libraries/Microsoft.Extensions.FileProviders.Physical/src/Microsoft.Extensions.FileProviders.Physical.csproj

Co-authored-by: Eric StJohn <[email protected]>

Co-authored-by: Eric StJohn <[email protected]>
2020-07-14 21:59:55 -07:00
Marie Píchová 149aa1e798 Implementations of new HttpContent sync methods. (#38635) 2020-07-10 08:52:35 +02:00
Stephen Toub cb1a7feaa4 Fix remaining license headers (#38953)
* Fix license in remainder of .cs files

* Fix license header in .vb files

* Fix license header in .py files

* Fix license headers in .c, .cpp, .h

* Fix licensing on .dat files

* Fix license header in generators

* Fix license headers in .asm

* Fix license headers in .xml

* Fix remainder of license headers

* Add license default to .editorconfig

* Add some missing headers

* Fix Doundation to Foundation in some license headers

* Add missing license headers under libraries
2020-07-08 20:35:26 -04:00
Stephen Toub 6072e4d3a7 Update license headers (#38793) 2020-07-08 09:23:11 -04:00
Alexander Köplinger 4c1b842607 Rewrite System.Net.Http.Json functional tests to use a custom HttpMessageHandler (#38733)
All of the tests start a socket-based loopback server which doesn't work on WebAssembly.
We can do the tests using a custom HttpMessageHandler instead of the loopback server as well.
2020-07-07 22:01:13 +02:00
Levi Broderick 74cfc0f25c Obsolete Encoding.UTF7 property and UTF7Encoding ctors (#37535)
- Disallow Encoding.GetEncoding("utf-7", ...) from returning an Encoding instance
- Minor code cleanup by removing unused ifdefs
- A compat switch is available to re-enable Encoding.GetEncoding("utf-7", ...)
2020-06-30 13:10:48 -07:00
Youssef Victor 98026a4648 Include Content-Type in exception in ReadFromJsonAsync (#36186)
* Update Strings.resx

* Update HttpContentJsonExtensions.cs
2020-05-11 11:05:14 -07:00
Viktor Hofer 2cda9035cb Use TargetFramework conditions consistently in libraries (#35956)
* Use TargetFramework condition consistently in libs

* Add docs section to describe the guideline

* Update Microsoft.Extensions.DependencyInjection.csproj

* Outline TargetFramework DesingTimeBuild issue

* Update Microsoft.Extensions.DependencyInjection.csproj
2020-05-11 11:00:11 -07:00
Levi Broderick 1f4393df55 Implement TranscodingStream (#35145)
This is a streaming analog to the one-shot Encoding.Convert method.
2020-04-30 13:50:48 -07:00
Eric Erhardt 0764d8c117 Set charset in editorconfig for .csproj (#35634)
* Add editorconfig charset for csproj files.

This stops VS from inserting a BOM in these files.

* Removing BOM from .csproj files.
2020-04-30 09:54:26 -05:00
Marcus Turewicz 890fab0a64 Use attribute Link syntax for Common files (#35436)
* Change <Link>...</Link> to Link="..."

* Format existing Link="..."
2020-04-25 05:26:50 -07:00
David Cantu bfbc19cd49 Fix Http.Json serialization performance by using static options (#35040) 2020-04-16 19:59:13 -07:00
Maxim Lipnin ab6e225d0c [mono] Remove CoreFX.issues_windows.rsp file (#32592)
Changes:
- enabled `runtime (Libraries Test Run release mono Windows_NT x64 Debug)` CI lane (Windows Nano Server CI leg is disabled);
- enabled the tests that pass;
- marked failing test assemblies/classes/methods with `ActiveIssue` attribute using respective GH issues;
- removed CoreFX.issues_windows.rsp file and related mono rsp arguments.

Fixes #1980
2020-04-10 12:41:57 +02:00
Viktor Hofer d0dc66bc0b Rename CoreFx.Private.TestUtilities and reference it in slns (#34656)
* Rename CoreFx.Private.TestUtilities to TestUtilities

* Add TestUtilities reference to slns
2020-04-08 01:26:53 +02:00
David CantuandJose Perez Rodriguez c6d463c7ea Add new System.Net.Http.Json project/namespace (#33459)
* Add System.Net.Http.Json related projects

* Add JsonContent, HttpContent extensions, and tests.

* Rename PErson.cs to Person.cs

* Adding package for System.Net.Http.Json library

* Improve tests, minor fixes and code clean-up.

* Remove annotations and code clean-up.

* Add draft description and common types to NuGet pkg.

* Addres nullability issues on API surface area.

* Add missing configurations to projects

* Addressing most of the  feedback.
TODO: Implement transcoding for non-UTF-8 content.

* Fix csproj formatting and use open StrongNameKeyId

* Address API review comments.

* Add transcoding support for .NET 5

* Port TranscodingRead/WriteStream to netstandard2.0

* Remove netcoreapp dependencies on TranscodingStream classes.

* Mark TransportContext as nullable to fix CI issues.

* Addres issues raised by new nullablity awareness code in System.Net.Http

* Re-enable LoopBackServer tests, address suggestions and code clean-up.

* Use default JsonSerializerOptions when passed-in is null

* Escape a few remaining Unicode characters in test files.

* Address nits.

* Validate inputType.IsAssignableFrom(inputValue.GetType()) on JsonContent ctor.

* Allow only ContentTypes application/json and application/<subtype>+json.

* Address comments.

* Add Unit.Tests project

* Make mediaType argument optional on JsonContent.Create

* Address latest comments.

* Perform case-insensitive comparisons on MediaType instead of ToLower.

* Address comments related to Transcoding classes.

* Address feedback

* Document TranscodingWriteStream.MaxByteBufferSize

* Replace MediaTypeHeaderValue.Parse with .ctor since it performs better.

Co-authored-by: Jose Perez Rodriguez <[email protected]>
2020-03-25 23:10:04 -07:00