* Change the default Nullable to enabled for src projects
* Set Nullable=enable as the default for ref projects
* Fixup merge conflicts
* Disable nullable on shim projects and EventLog.Messages
* Set Nullable to blank on EventLog.Messages
This way no CodeAnalysis attributes are emitted into the assembly.
* Remove usage of !! from dotnet/runtime
- Use ArgumentNullException.ThrowIfNull instead where possible. It's only usable for projects that only target .NET 6+, and it can't be used in places like this(...) or base(...).
- In other cases, if the project already has a ThrowHelper, augment it for null as needed and use that.
- For most of the extensions projects, add a ThrowHelper.ThrowIfNull that replicates ArgumentNullException.ThrowIfNull.
- For everything else, just use "throw new".
* Address PR feedback
* Address PR feedback
* Remove false positives from searches
* Address PR feedback
* Add dependency on Unsafe package
With the removal of the Unsafe package, a few projects regressed which
previously had a direct dependency on the latest version of Unsafe
(6.0.0) by now depending on the transitive Unsafe dependency of i.e.
System.Memory which is a very old version (4.5.*).
Fixing those projects to declare the direct dependency again.
* Cleanup
* Fix slngen.proj
The SolutionName property is defined by the SDK and hence the condition was always true. Also the star (*) didn't expand when using the ValurOrDefault msbuild function. Fixing this by using a different name `SolutionNameOverride` and avoiding the ValueOrDefault msbuild function.
* Update solution files
Updating the solution files as those changed because of
microsoft/slngen@cb57e28 and apparently the solution files never were
updated.
Allocate the buffer outside of the loop so we don't hit OOM issues.
While looking at the test I noticed that it actually had a bug too:
Nothing was asserting that we indeed throw an InvalidOperationException when the writer is completed. Adding `Assert.ThrowsAsync` revealed that the current loop iteration count was too low to hit the exception reliably
within the 10ms delay so instead check for the execution time.
Fixes https://github.com/dotnet/runtime/issues/64930
* Bump version of C# compiler
This should be reverted when arcade brings in a new enough compiler.
* Fix a few new warnings from updating compiler
* Enable IDE0190 to employ parameter null checking
* Initial roll out of !!
* Fix more compiler warnings from upgrade, plus some test fixes / reverts
* Fix a few more tests
* Disable profiling test
* Update docs for PipeReader.TryRead
As per https://github.com/dotnet/runtime/issues/30161#issuecomment-831035626, add some documentation to `PipeReader.TryRead` to better document some unclear behavior.
The unclear behavior technically resides in the `StreamPipeReader.TryRead` implementation, which is internal, so I added this as a `<remark>` to the public `PipeReader.TryRead` method instead.
* remove doc reference to internal StreamPipeReader
The StreamPipeReader <see .. /> reference is an internal type, so it should not be mentioned in the public documentation.
* Format remarks as markdown and use !IMPORTANT
Co-authored-by: Jeff Handley <[email protected]>
* Fix race condition with cancellation tokens in Read/Write operations
- There's a tight race where UnsafeRegister can fire inline and then ReadAsync never completes. This is because the cancellation token property has not been assigned yet so the callback noops. This change checks the result of the UnsafeRegister operation to see if ran synchronously and throws if it did. We also move any state transitions to after these checks to make sure the PipeAwaitable state doesn't change before throwing.
* Add a debug assert to make sure there's no state change.
* Add if debug
* More if DEBUG
* 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
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.
* Fixed StreamPipeReader.CopyToAsync
- Take the segment index into account when copying buffered data. This handles the case where ReadAsync has consumed a partial segment and then the same PipeReader instance is used to copy to a Stream and PipeWriter.
- Added tests
* Always slice
* automatically update the assembly version
* address feedback
* move IsAspNetCoreApp to packaging.targets
* make assemblyintef pack private, update header and instructions on building the package in servicing
* fixes the allconfig leg
* update the docs
* Update docs/project/library-servicing.md
Co-authored-by: Viktor Hofer <[email protected]>
Co-authored-by: Viktor Hofer <[email protected]>
* 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]>
* Clean-up pkgproj leftovers in libs and apply fixes
Remove any pkgproj infrastructure that was only used by src/libraries
(which is the majority). Delete the packageindex *YAY*.
Update the documentation that covered the packageindex and the pkgprojs.
Avoid any incremental builds during packaging by removing
libraries-packages.proj and use src.proj for packaging instead. Make use
of the `GeneratePackageOnBuild` property to build package during the
allconfigurations without requiring a different entry target.
Fix the addition of the DocumentationFile during packaging when
`GeneratePackageOnBuid` is used by hooking onto the
`DocumentationProjectOutputGroup` that NuGet uses and replacing the
generated documentation file with the one that comes via the
intellisense package.
Also introduce a property to choose the generated documentation file
over the one from the intellisense package:
<UseIntellisenseDocumentationFile>false</UseIntellisenseDocumentationFile>
Removing a few leftover PackageDescription properties from the projects'
Directory.Build.props file.
Cleaning up properties in Directory.Build.props & Directory.Build.targets
files.
* Actually run packaging during the allconfigurations build
* Update docs
* make runtime specific pkgs non packable
* io.ports native pkg fixes
* 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
Fixes#50576Fixes#50881Fixes#50916Fixes#50917Fixes#50918Fixes#50919Fixes#50927Fixes#50928Fixes#50944Fixes#50945Fixes#50946Fixes#50947Fixes#50948Fixes#50999
When setting up functional tests for mobile, the feature switches being used for the tests were misplaced in a broader project, affecting the library tests and causing failures. After moving the feature switches to the scope of functional tests as done in #53253, these test suites no longer fail and can be re-enabled.
* 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
* 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
- When there's no buffer allocated and the zero byte reads is cancelled, it'll try to make a read only sequence with the current buffer, if that buffer is null because it wasn't yet allocated, it'll end up throwing a null reference exception. This adds a check to make sure were return an empty ReadOnlySequence if the backing buffer is null.
- Added tests
Upgrading the netcoreapp2.x and netcoreapp3.0 build configurations in
projects to netcoreapp3.1 and cleaning up conditions so that future
tfm upgrades require less project file changes.
Adding NETStandardError markers to prevent available netstandard2.0
assets being picked instead, same as already done for System.Speech
and others.
For more details please see the reasoning in the linked issue.
Contributes to #53282
- Increase segment size based on minimumSize
- Use MaxBufferSize from custom memory pool
- Align segment allocation logic on Pipe one
- Group ReadAtLeastAsync tests
- Implemented the PipeReader implementation and override the method on Pipe.
- The Pipe implementation has some caveats. Calling ReadAtLeast messes with the pipe back pressure since it's trying to prevent deadlocks. This means that if ReadAsync is called with a big threshold, the writer will write as fast as it can ignoring the PauseThreshold up until the reader is unblocked. In a sense, the call to ReadAtLeast async overrides the pause threshold for that one read.
- Added tests
* 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
* Handle completed FlushResult on CopyToAsync
* Avoid the async state machine if write finishes synchronously
* Add test case for resume after target pipe is completed
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.