Commit Graph
782 Commits
Author SHA1 Message Date
Viktor Hofer 0964be0ae9 Update slngen and solution files (#60871)
Update slngen tooling to latest stable version and solution files since
a lot changed since the last time they were updated:
- NET7 (removal of older TFMs)
- Source Generators
2021-10-26 21:23:54 +02:00
Elinor Fung 39048dd5de Undo solution and config changes from DllImportGenerator (#60481)
* Remove dotnet-experimental feed from NuGet.config
* Revert changes to solution files and restore configs
2021-10-15 11:06:12 -07:00
Jeremy Koritzinsky 27034bc84b Run slngen to regenerate the solution files. 2021-09-22 17:02:14 -07:00
Jeremy Koritzinsky 81293bfc1e Merge branch 'main' of https://github.com/dotnet/runtime into merge-main 2021-09-14 16:29:42 -07:00
Eric Erhardt 9035d94a50 Multi-target Json and Logger Source Generators between Roslyn v3.11 and v4.0 (#58446)
* Multi-target LoggerMessageGenerator between Roslyn v3.11 and v4.0

* Include a .targets file in NuGet packages which will select the correct analyzer assembly depending on which Roslyn version will be used to compile.

* Multi-target JsonSourceGenerator between Roslyn v3.11 and v4.0

* Fix restore

* Update NuGet package MSBuild logic to detect when SupportsRoslynComponentVersioning is not available, and use the lowest analyzer available.

* Handle non-SDK projects by running after ResolveNuGetPackageAssets

* Respond to PR feedback

- Name .cs and .csproj files with Roslyn in the name
- Upgrade to Roslyn 3.11 so IsExplicitlyNamedTupleElement API is available
- Fix some references to the test projects
- Fix incremental pack of the analyzer targets
2021-09-13 22:05:45 -05:00
Viktor Hofer 331823f404 Simplify .NETFramework tfms (#58558)
* Simplfy .NETFramework tfms

Libraries which target .NET Framework usually have rid agnostic tfms,
i.e. net461. If the library targets netstandard2.0-windows as well,
the .NET Framework tfm must be rid specific, as rid specific
.NET Framework apps would otherwise pick the .NETStandard asset over
the .NETFramework one (based on the RID compatibility rules)

There is yet another reason that requires .NETFramework tfms to be RID
specific, which is when a project P2Ps other projects which are
rid-specific. Without the RID specific .NETFramework tfm, a compatible
.NETStandard asset would be picked instead.

NuGet doesn't support setting a TargetPlatform in the TargetFramework
alias when targeting .NETFramework or .NETStandard. Any such tfms in
dotnet/runtime are currently leveraging a hack that strips the
TargetPlatform / TargetFrameworkSuffix away during restore and packaging
(as NuGet Pack uses the project.assets.json file).

As NuGet will likely never support RID specific .NETFramework tfm
aliases, the distinction between a RID specific and a RID agnostic
.NETFramework tfm is unnecessary.

Remove all "TargetFrameworkSuffixes" / TargetPlatforms / RIDs
(whatever you would like to call them) from .NETFramework tfms and let
the packaging targets handle the cases where a RID specific asset is
required in the package.

Explictly don't set TargetsWindows to true for .NETFramework builds as
the Targets* properties are infered from the platform / suffix and
many projects make the assumption that net461
(without the "-windows" part) doesn't set TargetsWindows=true.

Fixes https://github.com/dotnet/runtime/issues/58495

* Warn on .NETFramework duplicate runtime assets

* Ignore .NEtFramework non Windows and non empty RIDs

Also cleaning up the packaging.targets file and removing
the ExcludeFromPackage option which isn't needed anymore as
target frameworks aren't excluded from packages produced in
dotnet/runtime anymore.
2021-09-10 09:50:11 +02:00
Tomas Weinfurt c515c50411 add W11 test queue (#58570) 2021-09-08 20:47:48 -06:00
Viktor Hofer 67354a2fb4 Upgrade to net7.0 and remove target frameworks (#58011)
* Remove EOL tfms and upgrade to net7.0

* Make linker tests net7 aware

Make installer tests run on net7.0

Don't attempt to use live apphost

Fix payloads

Regenerate test files

Fix package testing
2021-09-08 22:04:23 +02:00
Tomas Weinfurt 2e36b6024f add TLS 1.3 support to WinHttp (#58590)
* add TLS 1.3 support to WinHttp

* remove extra line

* fix comment

* add check if WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_3 is supported
2021-09-03 19:23:23 -07:00
Viktor Hofer 36b6247cc7 Update solution files for correct ordering of elements (#58655)
With the newest udpate of slngen, the order of elements (configuration, folders, etc.) is in sync with how Visual Studio arranges them.
Also the order is now deterministic.

Based on that, updating all solution files to have the correct ordering of elements. This change also unblocks adding CI protection for
making sure that solution files are up-to-date in regards to their dependencies as slngen is now generating the files deterministically.
2021-09-04 00:16:15 +02:00
Viktor Hofer 49c74eec15 Update changed solution files under src/libraries (#57483)
* Update slngen logic and remove unnecessary P2Ps

* Update changed soluion files under src/libraries

* Fix Platforms build

* Update comment in slngen.targets
2021-08-18 19:35:54 +02:00
Anton Firszov c8a658ccad WinHttp: Remove [SupportedOSPlatformAttribute] with specific Windows version (#57340) 2021-08-13 16:25:35 +02:00
Viktor HoferandSantiago Fernandez Madero 4d82932722 Automatically generate .NETStandard compat errors (#57057)
* Automatically generate .NETStandard compat errors

Before this change, a project had to explicitly add a
NETStandardCompatError item to declare that a given tfm range
shouldn't be supported when packaging.

Automate this logic so that projects don't need to specify the item
themselves anymore. Instead condition the NETStandardCompatError target
calcuation logic on the existence of both a .NETStandard and a
.NETCoreApp tfm.

* Update Directory.Build.targets

* Update packaging.targets

* Update eng/packaging.targets

Co-authored-by: Santiago Fernandez Madero <[email protected]>

Co-authored-by: Santiago Fernandez Madero <[email protected]>
2021-08-10 07:19:06 +02:00
Viktor Hofer 503ae5145a Replace all remaining pkgprojs with NuGet Pack task (#56712)
* Runtime specific and doc file packaging fixes

* Replace all remaining pkgprojs with NuGet Pack task

* Avoid NuGet/Home/issues/10368

* Update PackageValidation package to latest
2021-08-05 11:03:23 +02:00
Jeremy Koritzinsky 108fcdb61c Merge branch 'main' of github.com:dotnet/runtime into feature/use-dllimport-generator 2021-07-29 10:44:59 -07:00
Viktor Hofer a6b9a63f35 Update libraries solution and NuGet.config files (#56430)
* Update slngen and invocation

* Update NuGet.config files

* Update solution files with slngen
2021-07-28 18:44:17 +02:00
Huo Yaoyuan 69a4f832e5 Address System.Net.Http.WinHttpHandler's nullable warnings targeting .NETCoreApp (#54995)
* Update nullability for WinHttpHandler

* Update project file

* Use ! for PtrToStringUni

* Move assertion of _sessionHandle

* Remove false assertion about RequestHandle.
2021-07-13 20:11:58 -04:00
Stephen Toub dfd618dc64 Use interpolated strings in more places 2021-07-13 10:11:51 -04:00
Stephen Toub 1446bdb776 Fix LangVersion on several test projects 2021-07-13 10:11:51 -04:00
Stephen Toub 633e04481f Enable CA1419 (SafeHandle public parameterless ctor) (#55460) 2021-07-12 10:18:04 -04:00
Miha Zupan 9da4d075ef Remove Uri scheme validation from HttpRequestMessage (#55035)
* Remove Uri scheme validation from HttpRequestMessage

* PR feedback

Move HttpUtilities to SocketsHttpHandler

* Add request scheme check to WinHttpHandler

* Skip .NET 6 specific WinHttpHandler test on Framework

* Update InteropServices.JavaScript HttpRequestMessage test

* Guard HttpMessageInvoker from calling HttpTelemetry with invalid Uris

* PR feedback
2021-07-09 17:07:16 -07:00
Viktor Hofer b056b7b6a1 Add NetCoreAppCurrent configuration to libs (Phase 1) (#54544)
* Use property to indicate NetCoreApp min version

* Add NetCoreAppCurrent to S.Numerics.Tensors

* Add NetCoreAppCurrent to S.T.AccessControl

* Add NetCoreAppCurrent to System.Memory.Data

* Add NetCoreAppCurrent to S.Composition.* projects

* Add NetCoreAppCurrent to System.IO.Packaging

* Add NetCoreAppCurrent config to System.IO.Ports

Adding a NetCoreAppCurrent configuration to System.IO.Ports and
reducing package size, build times and platform specific assets by
using runtime checks on Unix derivates for the slightly diverging
SerialPort implementation.

Contributes to https://github.com/dotnet/runtime/issues/54012

* Add NetCoreAppCurrent to System.Data.OleDb

* Add NetCoreAppCurrent to M.W32.Registry.AccessControl

* Add NetCoreAppCurrent to S.Reflection.Context

* Add NetCoreAppCurrent to S.C.Composition.Registration

* Add NetCoreAppCurrent to S.Resources.Extensions

* Add NetCoreAppCurrent to S.N.H.WinHttpHandler
2021-06-29 22:15:47 +02:00
Tomas Weinfurt 2ac023c8e9 process more TLS frames at one when available (#50815)
* process more TLS frames when available

* add SslStream.Implementation.cs

* remove extra comment

* add back DefaultRequestHeaders_SentUnparsed

* feedback from review

* fix winhttp

* fix linker test

* feedback from review

* feedback from review

* feedback from review

* make EnsureFullTlsFrame async

* feedback from review
2021-06-24 16:31:07 +02:00
Elinor Fung 6271751fca Merge remote-tracking branch 'upstream/main' into HEAD 2021-06-11 10:04:20 -07:00
Elinor Fung 061e414d57 Use GeneratedDllImport in System.Net.Http (#53885) 2021-06-08 15:40:34 -07:00
Elinor Fung 3a66ebf408 Use GeneratedDllImport in System.Net.Security (#53839) 2021-06-07 16:44:39 -07:00
Pavel Savara 1e1951825b [wasm] Enable more networking tests (#53027)
- enable System.Net.Http.Functional.Tests on browser
- System.Net.Http.Functional.Tests to run in chrome instead of V8 via WasmTestOnBrowser
- ActiveIssue https://github.com/dotnet/runtime/issues/34690 for WebSocket on Windows Mono
- fix Quic detection in test
- disable webSocket tests on Mono/Windows
- disable tests with MaxConnectionsPerServer not supported on Browser
- disable tests with Socket not supported on Browser
- disable tests with AutomaticDecompression not supported on Browser
- disable tests with UseProxy not supported on Browser
- disable tests with PreAuthenticate not supported on Browser
- disable tests with Credentials is not supported on Browser
- disable tests with Loopback server
- run outerloop on browser, rather than V8 only
- [ActiveIssue] #37669 for missing crypto MD5
- conditional tests with PlatformDetection.IsBrowserDomSupportedOrNotBrowser to allow System.Net.Http.Functional.Tests pass on V8
- disabled tests with https://github.com/dotnet/runtime/issues/53018
- disabled tests with https://github.com/dotnet/runtime/issues/53591
- disabled tests with https://github.com/dotnet/runtime/issues/53592
2021-06-02 20:17:12 +02:00
Stephen Toub 72ff0df463 Enable recently added Microsoft.CodeAnalysis.NetAnalyzers rules (#53158) 2021-05-28 14:46:46 -04:00
James Newton-King 5a0edac8a8 WinHttpHandler: Add support for bidirectional streaming (#51094) 2021-05-18 10:58:59 +02:00
Viktor Hofer 8970941097 Stop harvesting old frameworks in some libraries (#51689)
* Stop harvesting old frameworks in some libraries

The removed configurations (few netstandard1.x, portable*, netcore50)
of the touched packages aren't built anymore. Instead
the already built matching binaries from the latest available packages
are redistributed when packaging these libraries.

Dropping these assets as the minimum supported set of platforms are ones
that support netstandard2.0. For .NET Framework, there's still a net461
configuration present to avoid binding redirect issues.

Contributes to #47530
2021-04-23 20:32:39 +02:00
Viktor Hofer fe6dd37068 Remove stale property (#51615)
The by the SDK default included netframework reference assembly are used instead of the old microsoft.netframework.targetingpack. Removing the stale property.
2021-04-21 19:30:34 +02:00
Jeff Handley c7e02f3773 Refactor build to use SupportedOSPlatforms instead of IsWindowsSpecific (#51450) 2021-04-19 21:52:12 -07:00
Geoff KizerandGeoffrey Kizer 288bfa00fe Rework request retry logic to be based on retry count limit (#48758)
* rework request retry logic to be based off a fixed retry limit (MaxConnectionFailureRetries) instead of isNewConnection logic

* be more conservative about request retries -- only allow on receiving EOF or GOAWAY from the server


Co-authored-by: Geoffrey Kizer <[email protected]>
2021-04-17 22:42:42 -07:00
Stephen Toub 0c793920f6 Clean up string formatting in a variety of places (#50267)
Mostly just replacing string.Format calls with equivalent interpolated string uses.  In some cases, I replaced lots of string creations with a StringBuilder or equivalent.
2021-04-04 23:16:23 -04:00
Jan JahodaandDan Moseley 78f980384f Credentials fix (#50230)
* Port of https://github.com/dotnet/corefx/pull/43051

* Shrink suppression file

* Fix another bugs

* Bump System.Net.TestData version

* Fix typo

* Revert casing in connection string

* Fix connection string case

* more fixes

* Change suppression messages

* Fix typo

* Remove false positive

* Fix usersecrets

Co-authored-by: Dan Moseley <[email protected]>
2021-03-25 21:18:38 -07:00
Stephen Toub 0817e748b7 Seal internal types in libraries (#50225) 2021-03-25 20:50:33 -04:00
Stephen Toub 48679143aa Seal private classes in libraries (#49969) 2021-03-23 06:14:55 -04: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
Stephen Toub 062ae9697d Add Task.WaitAsync methods (#48842) 2021-03-11 12:11:15 -05:00
Anton Firszov 423f5e1eb1 WinHttpHandler: Read HTTP/2 trailing headers
Fixes #44778
2021-03-10 11:54:22 +01:00
Lakshan FernandoandEric Erhardt 07ea61f581 Suppresses the trimmer warning on TypeAnalysis ctor (#48823)
* eh fix

* test change that inadvertently got checked in earlier

* Suppresses the trimmer warning on TypeAnalysis ctor

* Incorporating FB

* Update src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/DiagnosticSourceEventSource.cs

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

* Update src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/DiagnosticSourceEventSource.cs

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

* Update src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs

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

* Fix DynamicDependency as per PR feedback

* an earlier change got reverted

* fixed proj file netcore app condition check

* fixed NETCORE_ENGINEERING_TELEMETRY build failures

* fixeing another NETCORE_ENGINEERING_TELEMETRY build failures

* Adding RequiresUnreferencedCode to TypeAnalysis ctor instead of suppressing the warning to get FB, not fully fixed

* PR FB and suppressing warnings for safe calls

* propagated the warning all the way up

* CI build break fix for one file

* excluding NativeRTEventSrc from being build in a project

* Missed couple of supppressions on NativeRTEventSrc

* build break fixes

Co-authored-by: Eric Erhardt <[email protected]>
2021-03-08 14:40:58 -08:00
Anton Firszov c003837341 WinHttpHandler tests: AllowAllCertificates should not be static (#48817)
Altering the global state can break prerequisites of unrelated tests.
2021-03-02 12:09:19 +01:00
Geoff KizerandGeoffrey Kizer 57acd56766 Refactor some HTTP remote server tests (#47252)
move existing remote server tests in HttpClientHandlerTest.cs into a new file, HttpClientHandlerTest.RemoteServer.cs

Co-authored-by: Geoffrey Kizer <[email protected]>
2021-01-22 12:43:37 -08: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
Anton Firszov 18d1527c07 WinHttpHandler: apply [SupportedOSPlatform("windows10.0.19041")] on TcpKeepAlive properties (#45494)
WINHTTP_OPTION_TCP_KEEPALIVE is only available since the May 2020 Update, so it's reasonable to decorate the TcpKeepalive API with [SupportedOSPlatform]
2020-12-08 19:09:03 +01:00
Anton FirszovandJan Kotas 35744328d0 WinHttpHandler: fix double -> uint conversions for ARM64 (#45480)
* extend ReceiveDataTimeout functional coverage

* fix double -> uint conversions

* more comments + remove 'unchecked'

* Comment suggestion

Co-authored-by: Jan Kotas <[email protected]>

* Comment suggestion

Co-authored-by: Jan Kotas <[email protected]>

Co-authored-by: Jan Kotas <[email protected]>
2020-12-02 16:41:21 -08:00
Anirudh AgnihotryandViktor Hofer 659c5fbc7f disable restore in vs for projects targeting platform specific old frameworks (#44932)
* disable vs restore in vs for projects targeting platform specific older frameworks

* Add infra to auto-update solution files for restore

* Add NuGet.config files for solutions affected by restore issue

Co-authored-by: Viktor Hofer <[email protected]>
2020-12-02 23:18:52 +01:00
Anton Firszov 837785f9ca Implement TCP Keep-Alive for WinHttpHandler (#44889)
Implements the final version of the API proposal in #44025 except the [SupportedOSPlatform("windows10.0.2004")] bits
2020-11-25 15:13:09 +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 b37f10a504 Changing Windows_NT -> Windows for enabling TargetPlatformMoniker feature of the sdk for platform specific tfms. (#43651)
* eng change

* coreclr change

* libraries change

* tests change

* installer & mono change

* py files changed

* .md change

* .yml change

* remove redundant targetos property

* Windows_NT -> windows after ninja change

* fixing runtime build failure
2020-11-02 14:25:58 -08:00