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
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.
Fixes https://github.com/dotnet/runtime/issues/56847
The `EventSource_ExistsWithCorrectId` test requires the event source
switch be set to true to work correctly after aggressive linking.
* Remove old fwlink from Obsolete messages and make message improvements
* Thorough review and update of Obsolete messages
* Cleanup
* Make messages about unsupported APIs more consistent
* Update RequiresUnreferencedCodeAttribute messages to be consistent between ref and src
* Cleanup
* Cleanup
* Use 'not supported' instead of 'no longer supported'
* Omit unnecessary error:false from Obsolete attributes. Fix message typo.
* Remove old comment
* PR feedback
ArrayList.ToArray(Type) has to lookup the array type in the type loader structures. It makes it slow and potentially AOT unfriendly since the code required to support the array type may not exist.
Convert most uses of ArrayList.ToArray in libraries to use List<T> if possible, or ArrayList.CopyTo if the conversion to List<T> was not straightforward.
Simplified a few other places that created arrays while I was on it.
* replacing GetLastWin32Error with GetLastPInvokeError in remaining assemblies
* replace GetLastWin32Error with GetLastPInvokeError in assemblies outside system.private.corelib
* Apply suggestions from code review
Co-authored-by: Jan Kotas <[email protected]>
SocketAddressTest.ToString_UnsupportedFamily_Throws test fails on Android in case of AddressFamily.Packet and AddressFamily.ControllerAreaNetwork because it expects PNSE for both address family types but there is no any exception thrown.
This change disables the mentioned test on Android due to different behavior. Also, I'm not sure whether the test has right name.
#47911 (comment)
We have a bunch of test assemblies that don't make sense on some platforms, e.g. Browser.
Right now we're skipping them via `[SkipOnMono("reason", TestPlatforms.Browser)]` but there's nothing that inherently ties this to Mono other than the current implementation.
The more generic `SkipOnPlatform` attribute can be used instead.
We can also use it in places where we do `[PlatformSpecific(~TestPlatforms....)]` to avoid the double inversion.
* Fix various places that assumed host byte order was little-endian,
use appropriate host <-> network byte order conversion instead.
* This in particular affects handling of IPv4 addresses, which
are stored internally in network order.
* Fix endian assumptions in socket option code (GetSockOpt).
* Update test cases and provide /proc test files from a
big-endian system.
* Use [NotNullWhen(true)] in more places
Did a quick search/audit for methods that returned bool and took nullable object as the first input, and added [NotNullWhen(true)] where it was obviously correct.
* Address PR feedback
This changes the DateTime parsing to not convert the parsed Expires value to a Local datetime, potentially adding hours to it and making it invalid if it surpasses `DateTime.MaxValue`.
Fixes#45491
* Remove unnecessary OrderBy / copy from MemoryCache.Compact
* Replace First() in ILEmitResolverBuilder with [0]
* Remove stale "using System.Linq;" from System.Text.Json
* Remove stale "using System.Linq;" from System.Security.Cryptography.X509Certificates
* Remove some LINQ usage from System.Security.Cryptography.Pkcs
* Remove System.Linq reference from System.Private.Xml
* Remove System.Linq reference from System.Net.WebHeaderCollection
* Remove stale "using System.Linq;" from CookieContainer
* Remove stale "using System.Linq;" from AltSvcHeaderParser
* Remove Enumerable.Contains on a string from System.IO.Packaging
* Remove System.Linq dependency from System.Diagnostics.Process
* Remove LINQ usage from Microsoft.Extensions.Options
* Remove LINQ usage from Microsoft.Extensions.Logging
* Remove LINQ usage from Microsoft.Extensions.Logging.Console
* Remove LINQ from CollectionExtensions.GetAssets/RuntimeFiles
* Update src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Rfc3161TimestampToken.cs
Co-authored-by: Jeremy Barton <[email protected]>
Co-authored-by: Jeremy Barton <[email protected]>
At some point some Debug.Asserts/Fails were replaced by this NetEventSource.Fail helper, which both Debug.Fails and fires an EventSource event. But asserts in our code base are intended for things that should never happen, and we needn't be emitting events for them (if we did want to emit events for them, we'd need to tackle the other ~20,000 Debug.Assert/Fails in the codebase.
I've deleted NetEventSource.Fail, and fixed up the call sites. Some were simply replaced by Debug.Assert/Fail. Some were deleted entirely, when from code inspection it looked like they could actually be hit, but were guarded by a check for the event source being enabled and thus were unlikely to have been triggered in our previous testing. Etc.
* Fix various typos
* `occurence`, `occurance` -> `occurrence`
* `accross` -> `across`
* `adddress`, `addresss` -> `address`
* `alignement`, `aligment` -> `alignment`
* Remove `c` from triple c.
* Remove `s` from triple s.
* In palsuite, `Successs` (with triple s) was in commented out
`Trace()` message, removed all commented out `Trace()` calls
from such files.
* Fix invalid markdown in `unix-test-instructions.md`.
* Revert event source change
Resolves "Path related issues" of #26141
(described in #21440, #22372 and #25226) by adapting RFC 6265 for path management:
- Removes the restriction for the Path attribute (it's no longer expected to prefix the request path)
- Introduces the default-path calculation and path matching algorithms as defined in section 5.1.4 of the new RFC
- Adds integration tests for HttpClient based on user scenarios described in the issues
Minimal fix for domain-related cookie issues of #26141
To fully comply with RFC 6265, one should remove deprecated cookie
properties, such as Version, from public API. So only the stated
issues with leading dot were addressed now.
Also note that the leading dot was not stripped from the domain even
though RFC 6265 proposed it. This behavior was chosen because
browsers like Chrome and Edge also don't strip the leading dot.
- 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)"
Add HostInformationPal and InterfaceInfoPal implementations for Browser.
In CookiePortTest.cs use example.com instead of localhost for the tests since Browser uses `localhost` as the `Environment.MachineName` and that changes the test values.
Allows the tests to run on WebAssembly:
```
System.Net.Primitives.Pal.Tests: Tests run: 60, Errors: 0, Failures: 0, Skipped: 0. Time: 0.15872s
System.Net.Primitives.Functional.Tests: Tests run: 2620, Errors: 0, Failures: 0, Skipped: 1. Time: 3.145804s
```