* Fix VS complaining about missing projects in slns
Remove inbox (Project-)References in out-of-band projects as these
projects already build on top of the shared framework (targeting pack).
* Update Microsoft.Extensions ref projects
* Update Microsoft.Extensions src projects
* Update graph dependencies of Microsoft.Extensions*
* Update sources that complained about Span usage
* 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
* Use SDK logic for IsTrimmable
* Address some analyzer warnings
* Disable analyzer when baseline suppressions exist
* Don't mark unannotated test project as trimmable
* Add nativeaot annotations
* Add suppression in windows-only code
* Import illink.targets only when trimming mobile tests
* Don't run analyzer on unannotated windows OOBs
* PR feedback
Use pragma instead of UnconditionalSuppressMessage
* 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.
* 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
* [interp] Fix short branches
In interp, long branches have 4 byte signed offset while short branches have a 2 byte signed offset. Ideally we would want to always emit short branches if possible due to improved performance. The problem is that we emit a short or long branch early in the codegen process, there is no way to know whether a branch is long or short at that time and no further computations were done later to determine whether the branch is really long or short. Before this commit we arbitrarily decided that all branches in methods with IL size of less than 25000 are short and, in some cases, completely ignored that long branches actually happen in practice.
This commit makes it such that we always emit long opcodes at the beginning of the codegen process, also serving as a simplification since optimizations operating on IR code don't need to care about both short and long versions of branches. Later on, we will end up converting all these long branches to short branches when emitting the final method code. We achieve this by doing a quick preliminary code iteration and computing conservative native offsets (assuming all branches are long). Since the final code will be equal in size or smaller, we have the guarantee that if a branch is short between the conservative offsets, it will surely be short also in the final code. With this approach we guarantee correctness and we can fail to shorten only a negligible amount of branches.
Since the super instruction pass generates some branching instructions that are supported only for the short version, we need to run a computation of conservative offsets beforehand.
* Re-enable test suite
* 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.
* Improve AppendLiteral for short literals
DefaultInterpolatedStringHandler.AppendLiteral is special, in that the 99.9% use case is it's called as part of string interpolation by compiler-generated code where the argument is always a literal. That means when the method is inlined, the JIT can specialize the implementation based on knowing the literal's Length is a constant. Which means we can provide specialized implementations for common lengths, resulting in faster and smaller code. This does so for strings of length 1 and 2, as they're quite common in code bases examined, and it does so for both the default handler and also the handler used to format into a span.
The exact same code as before gets generated by the JIT for literals of length > 2. The main downside here is if someone does manually call this CompilerServices method with a variable, the call site will end up bloated with the special cases.
* Address PR feedback
* Disable some CodeDom tests on mono interpreter
* 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]>
* Failing tests where CodeDom creates invalid comment types
* Prevent CodeDom from creating invalid comment types
* Make C# generator impl more consistent with VB generator
* Switch attribute from ActiveIssue to SkipOnTargetFramework
* Be even more conservative about when the space is needed
* Attempt to improve readability
* Update VBCodeGenerationTests.cs
Co-authored-by: Dan Moseley <[email protected]>
* 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
* Don't reference ns.dll inside shared framework
The netstandard.dll shim shouldn't be referenced inside the shared
framework as it's a compat shim that shouldn't be required to compose
the shared framework.
This removes the necessity of a separate RefPath build and improves
incremental build times as only the few OOB projects that require the
shim would need to rebuild.
* Reference netstandard shim in OOBs that require it
There are a few OOB projects that require the netstandard.dll shim as
they intentionally reference projects that only expose a netstandard
configuration.
Co-authored-by: Buyaa Namnan <[email protected]>
* Remove NS1.x assets from build and packaging
These ten projects still built for netstandard1.x. This PR
trims out these assets from both the build which also results
in them not being packaged anymore as there is no harvesting
mechanism in the repository anymore.
Suppressing the package warnings for the intentionally dropped
assets and cleaning up conditions in the project file as well.
For more details please see the reasoning in the linked issue.
Contributes to https://github.com/dotnet/runtime/issues/53282
* Remove the use of IsPartialFacadeAssembly in refererences
This flag requires assembly-re-writing to replace type-defs in reference
assemblies with type forwards, when the same type exists in references.
We've pretty much exclusively used this on .NETFramework, since it's
not friendly to source build (CCI isn't part of source build).
.NETFramework isn't going to be changing so it doesn't save us much
to generate these typeforwards in the build.
We also used these to make sure the netstandard surface area was
compatible with .NETFramework facades (we'd use the pre-rewritten
reference assemblies for contract), but this need goes away now that we
have package validation based APICompat that compares netstandard refs
to net4x facades.
* Fix some projects I missed after changing naming convention
* Fixup another project
* Fix build of System.System.Threading.AccessControl
* Adding a section to ref-source docs on .NETFramework facades
* Address feedback
* Adding infrastructure to run the linker on OOB Assemblies manually
* Refactoring to abstract shared infrastructure
* Add OOB ignore list
* Address PR comments
* Rename properties so they don't intentionally get reused
* Addressing PR Feedback
* Addressing PR Feedback
* Move DesignerSerializerAttribute to S.CM.Primitives and add to StringDictionary
* Add TolboxItemAttribute to types that had it in Desktop
* Remove TypeDescriptionProviderAttribute from DefaultGenApiDocIds
* PR Feedback, fix build
- 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)"