diff --git a/NuGet.config b/NuGet.config
index 0d1eacbdec07b8..1aa8a689cf7a8c 100644
--- a/NuGet.config
+++ b/NuGet.config
@@ -10,6 +10,11 @@
+
+
+
+
+
diff --git a/docs/coding-guidelines/libraries-packaging.md b/docs/coding-guidelines/libraries-packaging.md
index f7c926890bf8e8..406937131c891d 100644
--- a/docs/coding-guidelines/libraries-packaging.md
+++ b/docs/coding-guidelines/libraries-packaging.md
@@ -18,6 +18,14 @@ Source generators and analyzers can be included in the shared framework by addin
Removing a library from the shared framework is a breaking change and should be avoided.
+### References to libraries in the shared framework that produce packages
+
+It's beneficial to avoid project references to libraries that are in the shared framework because it makes the package graph smaller which reduces the number of packages that require servicing and the number of libraries that end up being copied into the application directory.
+
+If a dependency is part of the shared framework a project/package reference is never required on the latest version (`NetCoreAppCurrent`). A reference is required for previous .NET versions even if the dependency is part of the shared framework if the project you are building targets .NETStandard and references the project there. You may completely avoid a package dependency on .NETStandard and .NET if it's not needed for .NETStandard (for example - if it is an implementation only dependency and you're building a PNSE assembly for .NETStandard).
+
+Warning NETPKG0001 is emitted when you have an unnecessary reference to a library that is part of the shared framework. To avoid this warning, make sure your ProjectReference is conditioned so that it doesn't apply on `NetCoreAppCurrent`.
+
## Transport package
Transport packages are non-shipping packages that dotnet/runtime produces in order to share binaries with other repositories.
diff --git a/docs/project/library-servicing.md b/docs/project/library-servicing.md
index bea41e65265b46..8c1f86be2694e3 100644
--- a/docs/project/library-servicing.md
+++ b/docs/project/library-servicing.md
@@ -16,6 +16,10 @@ If a library is packable (check for the `true` property
When you make a change to a library & ship it during the servicing release, the `ServicingVersion` must be bumped. This property is found in the library's source project. It's also possible that the property is not in that file, in which case you'll need to add it to the library's source project and set it to 1. If the property is already present in your library's source project, just increment the servicing version by 1.
+## Optionally ensure all up-stack packages are also produced
+
+If you wish to ensure that every package that references a serviced package is also serviced itself, you can enable validation by setting `ServiceTransitiveDependencies` to true. This can be done in an individual project, or globally. When doing this then building the repo, eg: `build libs -allConfigurations` you'll see errors from any project that didn't enable servicing. Reasons for forcing packages which depend on your package to service are security servicing or removing dependencies.
+
## Test your changes
All that's left is to ensure that your changes have worked as expected. To do so, execute the following steps:
diff --git a/docs/workflow/building/coreclr/linux-instructions.md b/docs/workflow/building/coreclr/linux-instructions.md
index 8e7457ff521850..0d28067fe7843c 100644
--- a/docs/workflow/building/coreclr/linux-instructions.md
+++ b/docs/workflow/building/coreclr/linux-instructions.md
@@ -60,12 +60,13 @@ All official builds are cross-builds with a rootfs for the target OS, and will u
| Host OS | Target OS | Target Arch | Image location | crossrootfs location |
| --------------------- | ------------ | --------------- | -------------------------------------------------------------------------------- | -------------------- |
-| CBL-mariner 2.0 (x64) | Alpine 3.13 | x64 | `mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-amd64-alpine` | `/crossrootfs/x64` |
-| CBL-mariner 2.0 (x64) | Ubuntu 16.04 | x64 | `mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-amd64` | `/crossrootfs/x64` |
-| CBL-mariner 2.0 (x64) | Alpine | arm32 (armhf) | `mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-arm-alpine` | `/crossrootfs/arm` |
-| CBL-mariner 2.0 (x64) | Ubuntu 16.04 | arm32 (armhf) | `mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-arm` | `/crossrootfs/arm` |
-| CBL-mariner 2.0 (x64) | Alpine | arm64 (arm64v8) | `mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-arm64-alpine` | `/crossrootfs/arm64` |
-| CBL-mariner 2.0 (x64) | Ubuntu 16.04 | arm64 (arm64v8) | `mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-arm64` | `/crossrootfs/arm64` |
+| Azure Linux (x64) | Alpine 3.13 | x64 | `mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-cross-amd64-alpine` | `/crossrootfs/x64` |
+| Azure Linux (x64) | Ubuntu 16.04 | x64 | `mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-cross-amd64` | `/crossrootfs/x64` |
+| Azure Linux (x64) | Alpine | arm32 (armhf) | `mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-cross-arm-alpine` | `/crossrootfs/arm` |
+| Azure Linux (x64) | Ubuntu 16.04 | arm32 (armhf) | `mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-cross-arm` | `/crossrootfs/arm` |
+| Azure Linux (x64) | Alpine | arm64 (arm64v8) | `mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-cross-arm64-alpine` | `/crossrootfs/arm64` |
+| Azure Linux (x64) | Ubuntu 16.04 | arm64 (arm64v8) | `mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-cross-arm64` | `/crossrootfs/arm64` |
+| Azure Linux (x64) | Ubuntu 16.04 | x86 | `mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-cross-x86` | `/crossrootfs/x86` |
| Ubuntu 18.04 (x64) | FreeBSD | x64 | `mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-cross-freebsd-12` | `/crossrootfs/x64` |
These Docker images are built using the Dockerfiles maintained in the [dotnet-buildtools-prereqs-docker repo](https://github.com/dotnet/dotnet-buildtools-prereqs-docker).
diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml
index e4f498d6eacf9a..6e45a2ae9593b4 100644
--- a/eng/Version.Details.xml
+++ b/eng/Version.Details.xml
@@ -99,9 +99,9 @@
d6672570f0fde2a4a3c7e65d60cec9f8406b039c
-
+
https://github.com/dotnet/source-build-reference-packages
- 30ed464acd37779c64e9dc652d4460543ebf9966
+ fe3794a68bd668d36d4d5014a9e6c9d22c0e6d86
@@ -354,9 +354,9 @@
https://dev.azure.com/dnceng/internal/_git/dotnet-optimization
67613417f5e1af250e6ddfba79f8f2885d8e90fb
-
+
https://github.com/dotnet/hotreload-utils
- 907017dae648b642c122f9a34573bd88ea0d9730
+ 5339e12def2a3605d069c429840089ae27838728
https://github.com/dotnet/runtime-assets
diff --git a/eng/Versions.props b/eng/Versions.props
index 82a77441ceec7a..654fcb841729af 100644
--- a/eng/Versions.props
+++ b/eng/Versions.props
@@ -188,7 +188,7 @@
8.0.0-prerelease.24229.2
8.0.0-prerelease.24229.2
8.0.0-prerelease.24229.2
- 8.0.0-alpha.0.24402.1
+ 8.0.0-alpha.0.24453.2
2.4.2
1.0.0
2.4.5
diff --git a/eng/packaging.targets b/eng/packaging.targets
index 67405cb51aeff0..2207a9d1f29a84 100644
--- a/eng/packaging.targets
+++ b/eng/packaging.targets
@@ -196,6 +196,21 @@
+
+
+
+
+
@@ -303,12 +318,47 @@
-
+
+
+ $(GeneratePackageOnBuild)
+
+
+
+
+
+
+ <_TransitiveServicedPackages
+ Condition="'%(ReferencePath.ReferenceSourceTarget)' == 'ProjectReference' and
+ '%(ReferencePath.GeneratePackageOnBuild)' == 'true'"
+ >@(ReferencePath->'%(OriginalProjectReferenceItemSpec)')
+
+
+
+
+
+
+
+
-
+ '$(DotNetBuildFromSource)' != 'true' and
+ '$(IsInnerBuild)' != 'true'"
+ AfterTargets="Build">
+
+
+
+
+
+
+
diff --git a/eng/pipelines/common/templates/pipeline-with-resources.yml b/eng/pipelines/common/templates/pipeline-with-resources.yml
index f5fd4abbd25bf8..70252b24e4ca96 100644
--- a/eng/pipelines/common/templates/pipeline-with-resources.yml
+++ b/eng/pipelines/common/templates/pipeline-with-resources.yml
@@ -17,7 +17,7 @@ extends:
containers:
linux_arm:
- image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-arm
+ image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-cross-arm
env:
ROOTFS_DIR: /crossrootfs/arm
@@ -27,23 +27,23 @@ extends:
ROOTFS_DIR: /crossrootfs/armv6
linux_arm64:
- image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-biarch-amd64-arm64
+ image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-cross-arm64
env:
ROOTFS_HOST_DIR: /crossrootfs/x64
ROOTFS_DIR: /crossrootfs/arm64
linux_musl_x64:
- image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-amd64-alpine
+ image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-cross-amd64-alpine
env:
ROOTFS_DIR: /crossrootfs/x64
linux_musl_arm:
- image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-arm-alpine
+ image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-cross-arm-alpine
env:
ROOTFS_DIR: /crossrootfs/arm
linux_musl_arm64:
- image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-arm64-alpine
+ image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-cross-arm64-alpine
env:
ROOTFS_DIR: /crossrootfs/arm64
@@ -56,12 +56,12 @@ extends:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-android-docker
linux_x64:
- image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-amd64
+ image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-cross-amd64
env:
ROOTFS_DIR: /crossrootfs/x64
linux_x86:
- image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-x86
+ image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-cross-x86
env:
ROOTFS_DIR: /crossrootfs/x86
diff --git a/eng/pipelines/coreclr/templates/helix-queues-setup.yml b/eng/pipelines/coreclr/templates/helix-queues-setup.yml
index 8f1d99396b4633..7d7acb772f82b4 100644
--- a/eng/pipelines/coreclr/templates/helix-queues-setup.yml
+++ b/eng/pipelines/coreclr/templates/helix-queues-setup.yml
@@ -48,7 +48,7 @@ jobs:
# Android x64
- ${{ if in(parameters.platform, 'android_x64') }}:
- - Ubuntu.2004.Amd64.Android.29.Open
+ - Ubuntu.2204.Amd64.Android.29.Open
# Browser wasm
- ${{ if eq(parameters.platform, 'browser_wasm') }}:
diff --git a/eng/pipelines/libraries/helix-queues-setup.yml b/eng/pipelines/libraries/helix-queues-setup.yml
index dcfa5a119db388..f2a7c9622eaaf5 100644
--- a/eng/pipelines/libraries/helix-queues-setup.yml
+++ b/eng/pipelines/libraries/helix-queues-setup.yml
@@ -72,6 +72,7 @@ jobs:
- Ubuntu.2204.Amd64.Open
- (Debian.12.Amd64.Open)Ubuntu.2204.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:debian-12-helix-amd64
- (Mariner.2.0.Amd64.Open)Ubuntu.2204.amd64.open@mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-helix-amd64
+ - (AzureLinux.3.0.Amd64.Open)Ubuntu.2204.Amd64.open@mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-helix-amd64
- (openSUSE.15.2.Amd64.Open)Ubuntu.2204.amd64.open@mcr.microsoft.com/dotnet-buildtools/prereqs:opensuse-15.2-helix-amd64
- ${{ if or(ne(parameters.jobParameters.isExtraPlatforms, true), eq(parameters.jobParameters.includeAllPlatforms, true)) }}:
- (Centos.9.Amd64.Open)Ubuntu.2204.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream9-helix
@@ -99,7 +100,7 @@ jobs:
# Android
- ${{ if in(parameters.platform, 'android_x86', 'android_x64', 'linux_bionic_x64') }}:
- - Ubuntu.2004.Amd64.Android.29.Open
+ - Ubuntu.2204.Amd64.Android.29.Open
- ${{ if in(parameters.platform, 'android_arm', 'android_arm64', 'linux_bionic_arm64') }}:
- Windows.11.Amd64.Android.Open
diff --git a/src/coreclr/jit/codegencommon.cpp b/src/coreclr/jit/codegencommon.cpp
index c6892747e0548d..f39596c1329df2 100644
--- a/src/coreclr/jit/codegencommon.cpp
+++ b/src/coreclr/jit/codegencommon.cpp
@@ -1289,9 +1289,8 @@ bool CodeGen::genCreateAddrMode(
{
cns += addConst->IconValue();
op2 = op2->AsOp()->gtOp1;
+ goto AGAIN;
}
-
- goto AGAIN;
}
break;
diff --git a/src/coreclr/jit/lowerxarch.cpp b/src/coreclr/jit/lowerxarch.cpp
index 8f3150e7e7b18e..7c309288de1eb6 100644
--- a/src/coreclr/jit/lowerxarch.cpp
+++ b/src/coreclr/jit/lowerxarch.cpp
@@ -4865,8 +4865,9 @@ GenTree* Lowering::LowerHWIntrinsicDot(GenTreeHWIntrinsic* node)
horizontalAdd = NI_SSE3_HorizontalAdd;
- if (!comp->compOpportunisticallyDependsOn(InstructionSet_SSE3))
+ if ((simdSize == 8) || !comp->compOpportunisticallyDependsOn(InstructionSet_SSE3))
{
+ // We also do this for simdSize == 8 to ensure we broadcast the result as expected
shuffle = NI_SSE_Shuffle;
}
break;
@@ -4917,10 +4918,8 @@ GenTree* Lowering::LowerHWIntrinsicDot(GenTreeHWIntrinsic* node)
horizontalAdd = NI_SSE3_HorizontalAdd;
- if (!comp->compOpportunisticallyDependsOn(InstructionSet_SSE3))
- {
- shuffle = NI_SSE2_Shuffle;
- }
+ // We need to ensure we broadcast the result as expected
+ shuffle = NI_SSE2_Shuffle;
break;
}
diff --git a/src/coreclr/jit/morph.cpp b/src/coreclr/jit/morph.cpp
index b20cd585882b87..3deada8eec085b 100644
--- a/src/coreclr/jit/morph.cpp
+++ b/src/coreclr/jit/morph.cpp
@@ -10724,16 +10724,6 @@ GenTree* Compiler::fgOptimizeHWIntrinsic(GenTreeHWIntrinsic* node)
break;
}
-#if defined(TARGET_XARCH)
- if ((node->GetSimdSize() == 8) && !compOpportunisticallyDependsOn(InstructionSet_SSE41))
- {
- // When SSE4.1 isn't supported then Vector2 only needs a single horizontal add
- // which means the result isn't broadcast across the entire vector and we can't
- // optimize
- break;
- }
-#endif // TARGET_XARCH
-
GenTree* op1 = node->Op(1);
GenTree* sqrt = nullptr;
GenTree* toScalar = nullptr;
diff --git a/src/coreclr/pal/src/thread/context.cpp b/src/coreclr/pal/src/thread/context.cpp
index b7e7c6fab35f05..e15f482e4c42fe 100644
--- a/src/coreclr/pal/src/thread/context.cpp
+++ b/src/coreclr/pal/src/thread/context.cpp
@@ -1496,6 +1496,12 @@ CONTEXT_GetThreadContextFromThreadState(
// AMD64's FLOATING_POINT includes the xmm registers.
memcpy(&lpContext->Xmm0, &pState->__fpu_xmm0, 16 * 16);
+
+ if (threadStateFlavor == x86_FLOAT_STATE64)
+ {
+ // There was just a floating point state, so make sure the CONTEXT_XSTATE is not set
+ lpContext->ContextFlags &= ~(CONTEXT_XSTATE & CONTEXT_AREA_MASK);
+ }
}
break;
}
diff --git a/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaType.TypeEquivalence.cs b/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaType.TypeEquivalence.cs
index 94d7722c28485f..b7fb3327a2655d 100644
--- a/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaType.TypeEquivalence.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaType.TypeEquivalence.cs
@@ -14,6 +14,7 @@ public partial class EcmaType
private TypeIdentifierData ComputeTypeIdentifierFromGuids()
{
CustomAttributeValue? guidAttribute;
+
if (IsInterface && _typeDefinition.Attributes.HasFlag(TypeAttributes.Import))
{
// ComImport interfaces get scope from their GUID
@@ -23,6 +24,7 @@ private TypeIdentifierData ComputeTypeIdentifierFromGuids()
{
// other equivalent types get it from the declaring assembly
var attributeHandle = this.MetadataReader.GetCustomAttributeHandle(MetadataReader.GetAssemblyDefinition().GetCustomAttributes(), "System.Runtime.InteropServices", "GuidAttribute");
+
if (attributeHandle.IsNil)
return null;
@@ -40,6 +42,7 @@ private TypeIdentifierData ComputeTypeIdentifierFromGuids()
string scope = (string)guidAttribute.Value.FixedArguments[0].Value;
string name = this.Name;
+
if (this.Namespace != null)
name = this.Namespace + "." + name;
@@ -53,6 +56,7 @@ private TypeIdentifierData ComputeTypeIdentifierData()
// Check for type identifier attribute
var typeIdentifierAttribute = this.GetDecodedCustomAttribute("System.Runtime.InteropServices", "TypeIdentifierAttribute");
+
if (typeIdentifierAttribute.HasValue)
{
// If the type has a type identifier attribute it is always considered to be type equivalent
@@ -68,28 +72,38 @@ private TypeIdentifierData ComputeTypeIdentifierData()
if (typeIdentifierAttribute.Value.FixedArguments[1].Type != Context.GetWellKnownType(WellKnownType.String))
return null;
- _data = new TypeIdentifierData((string)typeIdentifierAttribute.Value.FixedArguments[0].Value, (string)typeIdentifierAttribute.Value.FixedArguments[1].Value);
- return _data;
+ return new TypeIdentifierData((string)typeIdentifierAttribute.Value.FixedArguments[0].Value, (string)typeIdentifierAttribute.Value.FixedArguments[1].Value);
}
- else
+
+ // In addition to the TypeIdentifierAttribute certain other types may also be opted in to type equivalence
+ if (Context.SupportsCOMInterop)
{
- // In addition to the TypeIdentifierAttribute certain other types may also be opted in to type equivalence
- if (Context.SupportsCOMInterop)
+ // 1. The assembly is marked with ImportedFromTypeLibAttribute or PrimaryInteropAssemblyAttribute
+ // We will verify this by checking for their attribute handles using the Metadata Reader.
+
+ CustomAttributeHandle importedFromTypeLibHdl = this.MetadataReader.GetCustomAttributeHandle(
+ MetadataReader.GetAssemblyDefinition().GetCustomAttributes(),
+ "System.Runtime.InteropServices",
+ "ImportedFromTypeLibAttribute"
+ );
+
+ CustomAttributeHandle primaryInteropAssemblyHdl = this.MetadataReader.GetCustomAttributeHandle(
+ MetadataReader.GetAssemblyDefinition().GetCustomAttributes(),
+ "System.Runtime.InteropServices",
+ "PrimaryInteropAssemblyAttribute"
+ );
+
+ if (!importedFromTypeLibHdl.IsNil || !primaryInteropAssemblyHdl.IsNil)
{
- // 1. Type is within assembly marked with ImportedFromTypeLibAttribute or PrimaryInteropAssemblyAttribute
- if (this.HasCustomAttribute("System.Runtime.InteropServices", "ImportedFromTypeLibAttribute") || this.HasCustomAttribute("System.Runtime.InteropServices", "PrimaryInteropAssemblyAttribute"))
- {
- // This type has a TypeIdentifier attribute if it has an appropriate shape to be considered type equivalent
- }
-
+ // This type has a TypeIdentifier attribute if it has an appropriate shape to be considered type equivalent
if (!TypeHasCharacteristicsRequiredToBeTypeEquivalent)
return null;
- _data = ComputeTypeIdentifierFromGuids();
+ return ComputeTypeIdentifierFromGuids();
}
-
- return null;
}
+
+ return null;
}
public override TypeIdentifierData TypeIdentifierData
diff --git a/src/installer/tests/Assets/TestProjects/StandaloneApp3x/StandaloneApp3x.csproj b/src/installer/tests/Assets/TestProjects/StandaloneApp3x/StandaloneApp3x.csproj
index 567d0a28562310..27766f45945299 100644
--- a/src/installer/tests/Assets/TestProjects/StandaloneApp3x/StandaloneApp3x.csproj
+++ b/src/installer/tests/Assets/TestProjects/StandaloneApp3x/StandaloneApp3x.csproj
@@ -5,6 +5,7 @@
Exe
$(TestTargetRid)
true
+ true
$(NoWarn);CP0001
true
+ true
+ 1
Default implementation of dependency injection for Microsoft.Extensions.DependencyInjection.
diff --git a/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/CallSiteFactory.cs b/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/CallSiteFactory.cs
index 29f229c17fff8d..5505b3e2a6d1bb 100644
--- a/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/CallSiteFactory.cs
+++ b/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/CallSiteFactory.cs
@@ -571,6 +571,7 @@ private ConstructorCallSite CreateConstructorCallSite(
for (int index = 0; index < parameters.Length; index++)
{
ServiceCallSite? callSite = null;
+ bool isKeyedParameter = false;
Type parameterType = parameters[index].ParameterType;
foreach (var attribute in parameters[index].GetCustomAttributes(true))
{
@@ -588,11 +589,15 @@ private ConstructorCallSite CreateConstructorCallSite(
{
var parameterSvcId = new ServiceIdentifier(keyed.Key, parameterType);
callSite = GetCallSite(parameterSvcId, callSiteChain);
+ isKeyedParameter = true;
break;
}
}
- callSite ??= GetCallSite(ServiceIdentifier.FromServiceType(parameterType), callSiteChain);
+ if (!isKeyedParameter || ServiceProvider.s_allowNonKeyedServiceInject)
+ {
+ callSite ??= GetCallSite(ServiceIdentifier.FromServiceType(parameterType), callSiteChain);
+ }
if (callSite == null && ParameterDefaultValue.TryGetDefaultValue(parameters[index], out object? defaultValue))
{
diff --git a/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceProvider.cs b/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceProvider.cs
index ff5efbe98cf334..2eadf6e15a420d 100644
--- a/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceProvider.cs
+++ b/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceProvider.cs
@@ -40,6 +40,11 @@ public sealed class ServiceProvider : IServiceProvider, IKeyedServiceProvider, I
internal static bool DisableDynamicEngine { get; } =
AppContext.TryGetSwitch("Microsoft.Extensions.DependencyInjection.DisableDynamicEngine", out bool disableDynamicEngine) ? disableDynamicEngine : false;
+ internal static bool AllowNonKeyedServiceInject { get; } =
+ AppContext.TryGetSwitch("Microsoft.Extensions.DependencyInjection.AllowNonKeyedServiceInject", out bool allowNonKeyedServiceInject) ? allowNonKeyedServiceInject : false;
+
+ internal static readonly bool s_allowNonKeyedServiceInject = AllowNonKeyedServiceInject;
+
internal static bool VerifyAotCompatibility =>
#if NETFRAMEWORK || NETSTANDARD2_0
false;
diff --git a/src/libraries/Microsoft.Extensions.DependencyInjection/tests/DI.Tests/ServiceCollectionKeyedServiceExtensionsTest.cs b/src/libraries/Microsoft.Extensions.DependencyInjection/tests/DI.Tests/ServiceCollectionKeyedServiceExtensionsTest.cs
index 6be7e22cce2c35..e662cd9b337c4e 100644
--- a/src/libraries/Microsoft.Extensions.DependencyInjection/tests/DI.Tests/ServiceCollectionKeyedServiceExtensionsTest.cs
+++ b/src/libraries/Microsoft.Extensions.DependencyInjection/tests/DI.Tests/ServiceCollectionKeyedServiceExtensionsTest.cs
@@ -579,9 +579,9 @@ public static TheoryData NotNullServiceKeyData
public void NotNullServiceKey_IsKeyedServiceTrue(ServiceDescriptor serviceDescriptor)
{
Assert.True(serviceDescriptor.IsKeyedService);
- Assert.Throws(() => serviceDescriptor.ImplementationInstance);
- Assert.Throws(() => serviceDescriptor.ImplementationType);
- Assert.Throws(() => serviceDescriptor.ImplementationFactory);
+ Assert.Null(serviceDescriptor.ImplementationInstance);
+ Assert.Null(serviceDescriptor.ImplementationType);
+ Assert.Null(serviceDescriptor.ImplementationFactory);
}
}
}
diff --git a/src/libraries/Microsoft.Extensions.DependencyInjection/tests/DI.Tests/ServiceProviderContainerTests.cs b/src/libraries/Microsoft.Extensions.DependencyInjection/tests/DI.Tests/ServiceProviderContainerTests.cs
index 3e08a16db282e6..4c88d874e7b726 100644
--- a/src/libraries/Microsoft.Extensions.DependencyInjection/tests/DI.Tests/ServiceProviderContainerTests.cs
+++ b/src/libraries/Microsoft.Extensions.DependencyInjection/tests/DI.Tests/ServiceProviderContainerTests.cs
@@ -7,6 +7,7 @@
using System.Text;
using System.Threading;
using System.Threading.Tasks;
+using Microsoft.DotNet.RemoteExecutor;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.DependencyInjection.Fakes;
using Microsoft.Extensions.DependencyInjection.Specification;
@@ -1290,6 +1291,51 @@ public void ScopedServiceResolvedFromSingletonAfterCompilation3()
Assert.Same(sp.GetRequiredService>().Value.PropertyA, sp.GetRequiredService());
}
+ [Fact]
+ public void ResolveKeyedServiceWithKeyedParameter_MissingRegistrationButWithUnkeyedService()
+ {
+ var serviceCollection = new ServiceCollection();
+
+ // We are not registering "service1" and "service1" keyed IService services and OtherService requires them,
+ // but we are registering an unkeyed IService service which should not be injected into OtherService.
+ serviceCollection.AddSingleton();
+
+ serviceCollection.AddSingleton();
+
+ AggregateException ex = Assert.Throws(() => serviceCollection.BuildServiceProvider(new ServiceProviderOptions
+ {
+ ValidateOnBuild = true
+ }));
+
+ Assert.Equal(1, ex.InnerExceptions.Count);
+ Assert.StartsWith("Some services are not able to be constructed", ex.Message);
+ Assert.Contains("ServiceType: Microsoft.Extensions.DependencyInjection.Specification.KeyedDependencyInjectionSpecificationTests+OtherService", ex.ToString());
+ Assert.Contains("Microsoft.Extensions.DependencyInjection.Specification.KeyedDependencyInjectionSpecificationTests+IService", ex.ToString());
+ }
+
+ [ConditionalFact(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))]
+ [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework)] // RuntimeConfigurationOptions are not supported on .NET Framework (and neither is trimming)
+ public void ResolveKeyedServiceWithKeyedParameter_MissingRegistrationButWithUnkeyedService_FeatureSwitch()
+ {
+ RemoteInvokeOptions options = new ();
+ options.RuntimeConfigurationOptions["Microsoft.Extensions.DependencyInjection.AllowNonKeyedServiceInject"] = bool.TrueString;
+
+ using RemoteInvokeHandle remoteHandle = RemoteExecutor.Invoke(static () =>
+ {
+ Assert.True(ServiceProvider.s_allowNonKeyedServiceInject);
+
+ var serviceCollection = new ServiceCollection();
+
+ // Similar to the test above, but we are enabling the feature switch so we don't throw here.
+ serviceCollection.AddSingleton();
+ serviceCollection.AddSingleton();
+ serviceCollection.BuildServiceProvider(new ServiceProviderOptions
+ {
+ ValidateOnBuild = true
+ });
+ }, options);
+ }
+
private async Task ResolveUniqueServicesConcurrently()
{
var types = new Type[]
diff --git a/src/libraries/Microsoft.Extensions.DependencyModel/src/Microsoft.Extensions.DependencyModel.csproj b/src/libraries/Microsoft.Extensions.DependencyModel/src/Microsoft.Extensions.DependencyModel.csproj
index e135c23a6bb90f..c53c917361b1b2 100644
--- a/src/libraries/Microsoft.Extensions.DependencyModel/src/Microsoft.Extensions.DependencyModel.csproj
+++ b/src/libraries/Microsoft.Extensions.DependencyModel/src/Microsoft.Extensions.DependencyModel.csproj
@@ -3,8 +3,8 @@
$(NetCoreAppCurrent);$(NetCoreAppPrevious);$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum)
true
true
- false
- 1
+ true
+ 2
Provides abstractions for reading `.deps` files. When a .NET application is compiled, the SDK generates a JSON manifest file (`<ApplicationName>.deps.json`) that contains information about application dependencies. You can use `Microsoft.Extensions.DependencyModel` to read information from this manifest at run time. This is useful when you want to dynamically compile code (for example, using Roslyn Emit API) referencing the same dependencies as your main application.
By default, the dependency manifest contains information about the application's target framework and runtime dependencies. Set the PreserveCompilationContext project property to `true` to additionally include information about reference assemblies used during compilation.
@@ -22,7 +22,7 @@ By default, the dependency manifest contains information about the application's
-
+
@@ -30,10 +30,10 @@ By default, the dependency manifest contains information about the application's
-
+
-
+
@@ -46,5 +46,5 @@ By default, the dependency manifest contains information about the application's
-
+
diff --git a/src/libraries/Microsoft.Extensions.Diagnostics.Abstractions/src/Microsoft.Extensions.Diagnostics.Abstractions.csproj b/src/libraries/Microsoft.Extensions.Diagnostics.Abstractions/src/Microsoft.Extensions.Diagnostics.Abstractions.csproj
index a56170373401ee..69066028e63829 100644
--- a/src/libraries/Microsoft.Extensions.Diagnostics.Abstractions/src/Microsoft.Extensions.Diagnostics.Abstractions.csproj
+++ b/src/libraries/Microsoft.Extensions.Diagnostics.Abstractions/src/Microsoft.Extensions.Diagnostics.Abstractions.csproj
@@ -4,6 +4,8 @@
$(NetCoreAppCurrent);$(NetCoreAppPrevious);$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum)
true
true
+ true
+ 1
@@ -31,8 +33,11 @@ Microsoft.Extensions.Diagnostics.Metrics.MetricsOptions
-
+
+
+
+
diff --git a/src/libraries/Microsoft.Extensions.Diagnostics/src/Microsoft.Extensions.Diagnostics.csproj b/src/libraries/Microsoft.Extensions.Diagnostics/src/Microsoft.Extensions.Diagnostics.csproj
index 443137251e6412..c5cbe11dcabd39 100644
--- a/src/libraries/Microsoft.Extensions.Diagnostics/src/Microsoft.Extensions.Diagnostics.csproj
+++ b/src/libraries/Microsoft.Extensions.Diagnostics/src/Microsoft.Extensions.Diagnostics.csproj
@@ -8,6 +8,8 @@
should be removed in order to re-enable validation. -->
true
true
+ true
+ 1
This package includes the default implementation of IMeterFactory and additional extension methods to easily register it with the Dependency Injection framework.
diff --git a/src/libraries/Microsoft.Extensions.Hosting.Abstractions/src/Microsoft.Extensions.Hosting.Abstractions.csproj b/src/libraries/Microsoft.Extensions.Hosting.Abstractions/src/Microsoft.Extensions.Hosting.Abstractions.csproj
index c2a3841ec4902f..790938b691599b 100644
--- a/src/libraries/Microsoft.Extensions.Hosting.Abstractions/src/Microsoft.Extensions.Hosting.Abstractions.csproj
+++ b/src/libraries/Microsoft.Extensions.Hosting.Abstractions/src/Microsoft.Extensions.Hosting.Abstractions.csproj
@@ -5,6 +5,8 @@
Microsoft.Extensions.Hosting
true
true
+ true
+ 1
Hosting and startup abstractions for applications.
diff --git a/src/libraries/Microsoft.Extensions.Hosting.Systemd/src/Microsoft.Extensions.Hosting.Systemd.csproj b/src/libraries/Microsoft.Extensions.Hosting.Systemd/src/Microsoft.Extensions.Hosting.Systemd.csproj
index 94ee3bbf79c373..434042ad58b334 100644
--- a/src/libraries/Microsoft.Extensions.Hosting.Systemd/src/Microsoft.Extensions.Hosting.Systemd.csproj
+++ b/src/libraries/Microsoft.Extensions.Hosting.Systemd/src/Microsoft.Extensions.Hosting.Systemd.csproj
@@ -5,6 +5,8 @@
true
true
true
+ true
+ 1
.NET hosting infrastructure for Systemd Services.
diff --git a/src/libraries/Microsoft.Extensions.Hosting.WindowsServices/src/Microsoft.Extensions.Hosting.WindowsServices.csproj b/src/libraries/Microsoft.Extensions.Hosting.WindowsServices/src/Microsoft.Extensions.Hosting.WindowsServices.csproj
index 827ed114b0cf64..58822f2b49a5bd 100644
--- a/src/libraries/Microsoft.Extensions.Hosting.WindowsServices/src/Microsoft.Extensions.Hosting.WindowsServices.csproj
+++ b/src/libraries/Microsoft.Extensions.Hosting.WindowsServices/src/Microsoft.Extensions.Hosting.WindowsServices.csproj
@@ -4,6 +4,8 @@
$(NetCoreAppCurrent);$(NetCoreAppPrevious);$(NetCoreAppMinimum);netstandard2.1;netstandard2.0;$(NetFrameworkMinimum)
true
true
+ true
+ 1
.NET hosting infrastructure for Windows Services.
true
diff --git a/src/libraries/Microsoft.Extensions.Hosting/src/Microsoft.Extensions.Hosting.csproj b/src/libraries/Microsoft.Extensions.Hosting/src/Microsoft.Extensions.Hosting.csproj
index aac48bc7861490..6d699c5ade7387 100644
--- a/src/libraries/Microsoft.Extensions.Hosting/src/Microsoft.Extensions.Hosting.csproj
+++ b/src/libraries/Microsoft.Extensions.Hosting/src/Microsoft.Extensions.Hosting.csproj
@@ -5,6 +5,8 @@
true
Hosting and startup infrastructures for applications.
true
+ true
+ 1
diff --git a/src/libraries/Microsoft.Extensions.Http/src/Microsoft.Extensions.Http.csproj b/src/libraries/Microsoft.Extensions.Http/src/Microsoft.Extensions.Http.csproj
index 598f8974c25935..1e553f65ae93a4 100644
--- a/src/libraries/Microsoft.Extensions.Http/src/Microsoft.Extensions.Http.csproj
+++ b/src/libraries/Microsoft.Extensions.Http/src/Microsoft.Extensions.Http.csproj
@@ -4,6 +4,8 @@
$(NetCoreAppCurrent);$(NetCoreAppPrevious);$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum)
true
true
+ true
+ 1
The HttpClient factory is a pattern for configuring and retrieving named HttpClients in a composable way. The HttpClient factory provides extensibility to plug in DelegatingHandlers that address cross-cutting concerns such as service location, load balancing, and reliability. The default HttpClient factory provides built-in diagnostics and logging and manages the lifetimes of connections in a performant way.
Commonly Used Types:
diff --git a/src/libraries/Microsoft.Extensions.Logging.Abstractions/src/LogValuesFormatter.cs b/src/libraries/Microsoft.Extensions.Logging.Abstractions/src/LogValuesFormatter.cs
index beae39c00287ad..4f9832950084c2 100644
--- a/src/libraries/Microsoft.Extensions.Logging.Abstractions/src/LogValuesFormatter.cs
+++ b/src/libraries/Microsoft.Extensions.Logging.Abstractions/src/LogValuesFormatter.cs
@@ -192,32 +192,26 @@ internal string Format()
#if NET8_0_OR_GREATER
internal string Format(TArg0 arg0)
{
- object? arg0String = null;
return
- !TryFormatArgumentIfNullOrEnumerable(arg0, ref arg0String) ?
+ !TryFormatArgumentIfNullOrEnumerable(arg0, out object? arg0String) ?
string.Format(CultureInfo.InvariantCulture, _format, arg0) :
string.Format(CultureInfo.InvariantCulture, _format, arg0String);
}
internal string Format(TArg0 arg0, TArg1 arg1)
{
- object? arg0String = null, arg1String = null;
return
- !TryFormatArgumentIfNullOrEnumerable(arg0, ref arg0String) &&
- !TryFormatArgumentIfNullOrEnumerable(arg1, ref arg1String) ?
- string.Format(CultureInfo.InvariantCulture, _format, arg0, arg1) :
- string.Format(CultureInfo.InvariantCulture, _format, arg0String ?? arg0, arg1String ?? arg1);
- }
+ TryFormatArgumentIfNullOrEnumerable(arg0, out object? arg0String) | TryFormatArgumentIfNullOrEnumerable(arg1, out object? arg1String) ?
+ string.Format(CultureInfo.InvariantCulture, _format, arg0String ?? arg0, arg1String ?? arg1) :
+ string.Format(CultureInfo.InvariantCulture, _format, arg0, arg1);
+ }
internal string Format(TArg0 arg0, TArg1 arg1, TArg2 arg2)
{
- object? arg0String = null, arg1String = null, arg2String = null;
return
- !TryFormatArgumentIfNullOrEnumerable(arg0, ref arg0String) &&
- !TryFormatArgumentIfNullOrEnumerable(arg1, ref arg1String) &&
- !TryFormatArgumentIfNullOrEnumerable(arg2, ref arg2String) ?
- string.Format(CultureInfo.InvariantCulture, _format, arg0, arg1, arg2) :
- string.Format(CultureInfo.InvariantCulture, _format, arg0String ?? arg0, arg1String ?? arg1, arg2String ?? arg2);
+ TryFormatArgumentIfNullOrEnumerable(arg0, out object? arg0String) | TryFormatArgumentIfNullOrEnumerable(arg1, out object? arg1String) | TryFormatArgumentIfNullOrEnumerable(arg2, out object? arg2String) ?
+ string.Format(CultureInfo.InvariantCulture, _format, arg0String ?? arg0, arg1String ?? arg1, arg2String ?? arg2):
+ string.Format(CultureInfo.InvariantCulture, _format, arg0, arg1, arg2);
}
#else
internal string Format(object? arg0) =>
@@ -259,11 +253,10 @@ internal string Format(object? arg0, object? arg1, object? arg2) =>
private static object FormatArgument(object? value)
{
- object? stringValue = null;
- return TryFormatArgumentIfNullOrEnumerable(value, ref stringValue) ? stringValue : value!;
+ return TryFormatArgumentIfNullOrEnumerable(value, out object? stringValue) ? stringValue : value!;
}
- private static bool TryFormatArgumentIfNullOrEnumerable(T? value, [NotNullWhen(true)] ref object? stringValue)
+ private static bool TryFormatArgumentIfNullOrEnumerable(T? value, [NotNullWhen(true)] out object? stringValue)
{
if (value == null)
{
@@ -290,6 +283,7 @@ private static bool TryFormatArgumentIfNullOrEnumerable(T? value, [NotNullWhe
return true;
}
+ stringValue = null;
return false;
}
}
diff --git a/src/libraries/Microsoft.Extensions.Logging.Abstractions/src/Microsoft.Extensions.Logging.Abstractions.csproj b/src/libraries/Microsoft.Extensions.Logging.Abstractions/src/Microsoft.Extensions.Logging.Abstractions.csproj
index cfb15ea788e9e5..087ad684431f9f 100644
--- a/src/libraries/Microsoft.Extensions.Logging.Abstractions/src/Microsoft.Extensions.Logging.Abstractions.csproj
+++ b/src/libraries/Microsoft.Extensions.Logging.Abstractions/src/Microsoft.Extensions.Logging.Abstractions.csproj
@@ -5,8 +5,8 @@
true
true
true
- false
- 1
+ true
+ 2
Logging abstractions for Microsoft.Extensions.Logging.
Commonly Used Types:
@@ -40,6 +40,10 @@ Microsoft.Extensions.Logging.Abstractions.NullLogger
+
+
+
+
diff --git a/src/libraries/Microsoft.Extensions.Logging.Configuration/src/Microsoft.Extensions.Logging.Configuration.csproj b/src/libraries/Microsoft.Extensions.Logging.Configuration/src/Microsoft.Extensions.Logging.Configuration.csproj
index 820eb7fa062e72..faf13fa8cb3047 100644
--- a/src/libraries/Microsoft.Extensions.Logging.Configuration/src/Microsoft.Extensions.Logging.Configuration.csproj
+++ b/src/libraries/Microsoft.Extensions.Logging.Configuration/src/Microsoft.Extensions.Logging.Configuration.csproj
@@ -8,6 +8,8 @@
$(InterceptorsPreviewNamespaces);Microsoft.Extensions.Configuration.Binder.SourceGeneration
true
true
+ true
+ 1
Configuration support for Microsoft.Extensions.Logging.
diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/Microsoft.Extensions.Logging.Console.csproj b/src/libraries/Microsoft.Extensions.Logging.Console/src/Microsoft.Extensions.Logging.Console.csproj
index e83340eb0eae55..877c57a45288cc 100644
--- a/src/libraries/Microsoft.Extensions.Logging.Console/src/Microsoft.Extensions.Logging.Console.csproj
+++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/Microsoft.Extensions.Logging.Console.csproj
@@ -7,6 +7,8 @@
$(DefineConstants);NO_SUPPRESS_GC_TRANSITION
true
true
+ true
+ 1
$(Features);InterceptorsPreview
$(InterceptorsPreviewNamespaces);Microsoft.Extensions.Configuration.Binder.SourceGeneration
@@ -49,6 +51,9 @@
+
+
+
diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/tests/Microsoft.Extensions.Logging.Console.Tests/ConsoleLoggerTest.cs b/src/libraries/Microsoft.Extensions.Logging.Console/tests/Microsoft.Extensions.Logging.Console.Tests/ConsoleLoggerTest.cs
index 0994980590122b..ab8c88f4ba3c45 100644
--- a/src/libraries/Microsoft.Extensions.Logging.Console/tests/Microsoft.Extensions.Logging.Console.Tests/ConsoleLoggerTest.cs
+++ b/src/libraries/Microsoft.Extensions.Logging.Console/tests/Microsoft.Extensions.Logging.Console.Tests/ConsoleLoggerTest.cs
@@ -32,7 +32,7 @@ internal static IEnumerable GetFormatters(
var defaultMonitor = new TestFormatterOptionsMonitor(simpleOptions ?? new SimpleConsoleFormatterOptions());
var systemdMonitor = new TestFormatterOptionsMonitor(systemdOptions ?? new ConsoleFormatterOptions());
var jsonMonitor = new TestFormatterOptionsMonitor(jsonOptions ?? new JsonConsoleFormatterOptions());
- var formatters = new List() {
+ var formatters = new List() {
new SimpleConsoleFormatter(defaultMonitor),
new SystemdConsoleFormatter(systemdMonitor),
new JsonConsoleFormatter(jsonMonitor)
@@ -86,13 +86,13 @@ private static void VerifyDeprecatedPropertiesUsedOnNullFormatterName(ConsoleLog
Assert.Equal(formatter.FormatterOptions.IncludeScopes, logger.Options.IncludeScopes);
Assert.Equal(formatter.FormatterOptions.UseUtcTimestamp, logger.Options.UseUtcTimestamp);
Assert.Equal(formatter.FormatterOptions.TimestampFormat, logger.Options.TimestampFormat);
- Assert.Equal(formatter.FormatterOptions.ColorBehavior,
- logger.Options.DisableColors ? LoggerColorBehavior.Disabled : LoggerColorBehavior.Enabled);
+ Assert.Equal(formatter.FormatterOptions.ColorBehavior,
+ logger.Options.DisableColors ? LoggerColorBehavior.Disabled : LoggerColorBehavior.Enabled);
}
else
{
var formatter = Assert.IsType(logger.Formatter);
- Assert.Equal(formatter.FormatterOptions.IncludeScopes, logger.Options.IncludeScopes);
+ Assert.Equal(formatter.FormatterOptions.IncludeScopes, logger.Options.IncludeScopes);
Assert.Equal(formatter.FormatterOptions.UseUtcTimestamp, logger.Options.UseUtcTimestamp);
Assert.Equal(formatter.FormatterOptions.TimestampFormat, logger.Options.TimestampFormat);
}
@@ -103,7 +103,7 @@ private static void UpdateFormatterOptions(ConsoleFormatter formatter, ConsoleLo
// kept for deprecated apis:
if (formatter is SimpleConsoleFormatter defaultFormatter)
{
- defaultFormatter.FormatterOptions.ColorBehavior = deprecatedFromOptions.DisableColors ?
+ defaultFormatter.FormatterOptions.ColorBehavior = deprecatedFromOptions.DisableColors ?
LoggerColorBehavior.Disabled : LoggerColorBehavior.Enabled;
defaultFormatter.FormatterOptions.IncludeScopes = deprecatedFromOptions.IncludeScopes;
defaultFormatter.FormatterOptions.TimestampFormat = deprecatedFromOptions.TimestampFormat;
@@ -1346,6 +1346,31 @@ public void ConsoleLoggerOptions_IncludeScopes_IsReadFromLoggingConfiguration()
Assert.True(formatter.FormatterOptions.IncludeScopes);
}
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ public void LogMultipleArrays()
+ {
+ // Arrange
+ var t = SetUp();
+ var logger = t.Logger;
+ var sink = t.Sink;
+
+ var define1 = LoggerMessage.Define(LogLevel.Information, new EventId(), "Log: {Array1} and {Array2}");
+ var define2 = LoggerMessage.Define(LogLevel.Information, new EventId(), "Log {Number}: {Array1} and {Array2}");
+
+ // Act
+ define1(logger, ["a", "b", "c"], ["d", "e", "f"], null);
+ define2(logger, 30, ["a", "b", "c"], ["d", "e", "f"], null);
+
+ var expectedMessage1 = $"{CreateHeader(ConsoleLoggerFormat.Default)}{Environment.NewLine}{_paddingString}Log: a, b, c and d, e, f{Environment.NewLine}";
+ var expectedMessage2 = $"{CreateHeader(ConsoleLoggerFormat.Default)}{Environment.NewLine}{_paddingString}Log 30: a, b, c and d, e, f{Environment.NewLine}";
+
+ Assert.Equal(4, sink.Writes.Count);
+ Assert.Equal("info", sink.Writes[0].Message);
+ Assert.Equal(expectedMessage1, sink.Writes[1].Message);
+ Assert.Equal("info", sink.Writes[2].Message);
+ Assert.Equal(expectedMessage2, sink.Writes[3].Message);
+ }
+
public static TheoryData FormatsAndLevels
{
get
diff --git a/src/libraries/Microsoft.Extensions.Logging.Debug/src/Microsoft.Extensions.Logging.Debug.csproj b/src/libraries/Microsoft.Extensions.Logging.Debug/src/Microsoft.Extensions.Logging.Debug.csproj
index da5ffceed4231e..b534471c34ab7d 100644
--- a/src/libraries/Microsoft.Extensions.Logging.Debug/src/Microsoft.Extensions.Logging.Debug.csproj
+++ b/src/libraries/Microsoft.Extensions.Logging.Debug/src/Microsoft.Extensions.Logging.Debug.csproj
@@ -4,6 +4,8 @@
$(NetCoreAppCurrent);$(NetCoreAppPrevious);$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum)
true
true
+ true
+ 1
Debug output logger provider implementation for Microsoft.Extensions.Logging. This logger logs messages to a debugger monitor by writing messages with System.Diagnostics.Debug.WriteLine().
diff --git a/src/libraries/Microsoft.Extensions.Logging.EventLog/src/Microsoft.Extensions.Logging.EventLog.csproj b/src/libraries/Microsoft.Extensions.Logging.EventLog/src/Microsoft.Extensions.Logging.EventLog.csproj
index 140fddf49e83b7..38c1909633cd8a 100644
--- a/src/libraries/Microsoft.Extensions.Logging.EventLog/src/Microsoft.Extensions.Logging.EventLog.csproj
+++ b/src/libraries/Microsoft.Extensions.Logging.EventLog/src/Microsoft.Extensions.Logging.EventLog.csproj
@@ -4,6 +4,8 @@
$(NetCoreAppCurrent);$(NetCoreAppPrevious);$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum)
true
true
+ true
+ 1
Windows Event Log logger provider implementation for Microsoft.Extensions.Logging.
diff --git a/src/libraries/Microsoft.Extensions.Logging.EventSource/src/Microsoft.Extensions.Logging.EventSource.csproj b/src/libraries/Microsoft.Extensions.Logging.EventSource/src/Microsoft.Extensions.Logging.EventSource.csproj
index 3f4ab0080443cc..57c8653fde3925 100644
--- a/src/libraries/Microsoft.Extensions.Logging.EventSource/src/Microsoft.Extensions.Logging.EventSource.csproj
+++ b/src/libraries/Microsoft.Extensions.Logging.EventSource/src/Microsoft.Extensions.Logging.EventSource.csproj
@@ -5,6 +5,8 @@
true
true
true
+ true
+ 1
EventSource/EventListener logger provider implementation for Microsoft.Extensions.Logging.
@@ -29,7 +31,10 @@
-
+
+
+
+
diff --git a/src/libraries/Microsoft.Extensions.Logging.TraceSource/src/Microsoft.Extensions.Logging.TraceSource.csproj b/src/libraries/Microsoft.Extensions.Logging.TraceSource/src/Microsoft.Extensions.Logging.TraceSource.csproj
index 6568c9908c14f2..7d26e0db14499d 100644
--- a/src/libraries/Microsoft.Extensions.Logging.TraceSource/src/Microsoft.Extensions.Logging.TraceSource.csproj
+++ b/src/libraries/Microsoft.Extensions.Logging.TraceSource/src/Microsoft.Extensions.Logging.TraceSource.csproj
@@ -4,6 +4,8 @@
$(NetCoreAppCurrent);$(NetCoreAppPrevious);$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum)
true
true
+ true
+ 1
TraceSource logger provider implementation for Microsoft.Extensions.Logging. This logger logs messages to a trace listener by writing messages with System.Diagnostics.TraceSource.TraceEvent().
diff --git a/src/libraries/Microsoft.Extensions.Logging/src/Microsoft.Extensions.Logging.csproj b/src/libraries/Microsoft.Extensions.Logging/src/Microsoft.Extensions.Logging.csproj
index 8501fd465db6e5..fd85f184890eb5 100644
--- a/src/libraries/Microsoft.Extensions.Logging/src/Microsoft.Extensions.Logging.csproj
+++ b/src/libraries/Microsoft.Extensions.Logging/src/Microsoft.Extensions.Logging.csproj
@@ -4,6 +4,8 @@
$(NetCoreAppCurrent);$(NetCoreAppPrevious);$(NetCoreAppMinimum);netstandard2.1;netstandard2.0;$(NetFrameworkMinimum)
true
true
+ true
+ 1
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
@@ -27,7 +29,7 @@
-
+
diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System.ComponentModel.TypeConverter.csproj b/src/libraries/System.ComponentModel.TypeConverter/src/System.ComponentModel.TypeConverter.csproj
index f8b998c751ef22..fd01b2a1614a4f 100644
--- a/src/libraries/System.ComponentModel.TypeConverter/src/System.ComponentModel.TypeConverter.csproj
+++ b/src/libraries/System.ComponentModel.TypeConverter/src/System.ComponentModel.TypeConverter.csproj
@@ -253,6 +253,7 @@
SetTargetFramework="TargetFramework=netstandard2.0"
OutputItemType="Analyzer" />
+
diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/PropertyDescriptor.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/PropertyDescriptor.cs
index 51fad8dd06d90c..90db74959d1572 100644
--- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/PropertyDescriptor.cs
+++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/PropertyDescriptor.cs
@@ -2,9 +2,11 @@
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections;
+using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Reflection;
+using System.Threading;
namespace System.ComponentModel
{
@@ -16,10 +18,11 @@ public abstract class PropertyDescriptor : MemberDescriptor
internal const string PropertyDescriptorPropertyTypeMessage = "PropertyDescriptor's PropertyType cannot be statically discovered.";
private TypeConverter? _converter;
- private Dictionary
-
+
diff --git a/src/libraries/System.Data.Odbc/src/System.Data.Odbc.csproj b/src/libraries/System.Data.Odbc/src/System.Data.Odbc.csproj
index 356e81f71489f4..a4e1d023274629 100644
--- a/src/libraries/System.Data.Odbc/src/System.Data.Odbc.csproj
+++ b/src/libraries/System.Data.Odbc/src/System.Data.Odbc.csproj
@@ -5,6 +5,8 @@
$(NoWarn);CA2249;CA1838
false
true
+ true
+ 1
Provides a collection of classes used to access an ODBC data source in the managed space
Commonly Used Types:
@@ -161,7 +163,4 @@ System.Data.Odbc.OdbcTransaction
-
-
-
diff --git a/src/libraries/System.Data.OleDb/src/System.Data.OleDb.csproj b/src/libraries/System.Data.OleDb/src/System.Data.OleDb.csproj
index bb549009216e33..96acfcbb72f133 100644
--- a/src/libraries/System.Data.OleDb/src/System.Data.OleDb.csproj
+++ b/src/libraries/System.Data.OleDb/src/System.Data.OleDb.csproj
@@ -8,6 +8,8 @@
$(NoWarn);SYSLIB0004
false
true
+ true
+ 1
Provides a collection of classes for OLEDB.
Commonly Used Types:
diff --git a/src/libraries/System.Diagnostics.EventLog/src/System.Diagnostics.EventLog.csproj b/src/libraries/System.Diagnostics.EventLog/src/System.Diagnostics.EventLog.csproj
index 5bf9cee3c8725a..32185c679f3d1d 100644
--- a/src/libraries/System.Diagnostics.EventLog/src/System.Diagnostics.EventLog.csproj
+++ b/src/libraries/System.Diagnostics.EventLog/src/System.Diagnostics.EventLog.csproj
@@ -3,7 +3,7 @@
$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent);$(NetCoreAppPrevious)-windows;$(NetCoreAppPrevious);$(NetCoreAppMinimum)-windows;$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum)
true
true
- true
+ false
1
Provides the System.Diagnostics.EventLog class, which allows the applications to use the Windows event log service.
diff --git a/src/libraries/System.Diagnostics.PerformanceCounter/src/System.Diagnostics.PerformanceCounter.csproj b/src/libraries/System.Diagnostics.PerformanceCounter/src/System.Diagnostics.PerformanceCounter.csproj
index 8f8c2613c20613..c6024f6b92ae0f 100644
--- a/src/libraries/System.Diagnostics.PerformanceCounter/src/System.Diagnostics.PerformanceCounter.csproj
+++ b/src/libraries/System.Diagnostics.PerformanceCounter/src/System.Diagnostics.PerformanceCounter.csproj
@@ -3,6 +3,8 @@
$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent);$(NetCoreAppPrevious)-windows;$(NetCoreAppPrevious);$(NetCoreAppMinimum)-windows;$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum)
true
true
+ true
+ 1
Provides the System.Diagnostics.PerformanceCounter class, which allows access to Windows performance counters.
Commonly Used Types:
diff --git a/src/libraries/System.DirectoryServices.AccountManagement/src/System.DirectoryServices.AccountManagement.csproj b/src/libraries/System.DirectoryServices.AccountManagement/src/System.DirectoryServices.AccountManagement.csproj
index 31119b28425124..518f441dc9d0df 100644
--- a/src/libraries/System.DirectoryServices.AccountManagement/src/System.DirectoryServices.AccountManagement.csproj
+++ b/src/libraries/System.DirectoryServices.AccountManagement/src/System.DirectoryServices.AccountManagement.csproj
@@ -7,6 +7,8 @@
$(NoWarn);IDE0059;IDE0060;CA1822;CA1859
false
true
+ true
+ 1
true
true
Provides uniform access and manipulation of user, computer, and group security principals across the multiple principal stores: Active Directory Domain Services (AD DS), Active Directory Lightweight Directory Services (AD LDS), and Machine SAM (MSAM).
diff --git a/src/libraries/System.Memory.Data/src/System.Memory.Data.csproj b/src/libraries/System.Memory.Data/src/System.Memory.Data.csproj
index 639e4a3dfdf4fa..ab32e2805f0b6a 100644
--- a/src/libraries/System.Memory.Data/src/System.Memory.Data.csproj
+++ b/src/libraries/System.Memory.Data/src/System.Memory.Data.csproj
@@ -3,6 +3,8 @@
$(NetCoreAppCurrent);$(NetCoreAppPrevious);$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum)
true
true
+ true
+ 1
A lightweight abstraction for a payload of bytes. Provides methods for converting between strings, streams, JSON, and bytes.
Commonly Used Types:
@@ -23,8 +25,8 @@ System.BinaryData
-
-
+
+
diff --git a/src/libraries/System.Net.Http.Json/src/System.Net.Http.Json.csproj b/src/libraries/System.Net.Http.Json/src/System.Net.Http.Json.csproj
index 08375656e0598b..dbd3fa7d7ebab7 100644
--- a/src/libraries/System.Net.Http.Json/src/System.Net.Http.Json.csproj
+++ b/src/libraries/System.Net.Http.Json/src/System.Net.Http.Json.csproj
@@ -2,6 +2,8 @@
$(NetCoreAppCurrent);$(NetCoreAppPrevious);$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum)
true
+ true
+ 1
Provides extension methods for System.Net.Http.HttpClient and System.Net.Http.HttpContent that perform automatic serialization and deserialization using System.Text.Json.
Commonly Used Types:
@@ -52,7 +54,7 @@ System.Net.Http.Json.JsonContent
-
+
@@ -60,6 +62,7 @@ System.Net.Http.Json.JsonContent
+
diff --git a/src/libraries/System.Private.CoreLib/src/System/Number.Parsing.cs b/src/libraries/System.Private.CoreLib/src/System/Number.Parsing.cs
index 77164243594258..2aefc7c407685d 100644
--- a/src/libraries/System.Private.CoreLib/src/System/Number.Parsing.cs
+++ b/src/libraries/System.Private.CoreLib/src/System/Number.Parsing.cs
@@ -107,7 +107,7 @@ private static unsafe bool TryNumberBufferToBinaryInteger(ref NumberBu
int i = number.Scale;
- if ((i > TInteger.MaxDigitCount) || (i < number.DigitsCount) || (!TInteger.IsSigned && number.IsNegative))
+ if ((i > TInteger.MaxDigitCount) || (i < number.DigitsCount) || (!TInteger.IsSigned && number.IsNegative) || number.HasNonZeroTail)
{
return false;
}
diff --git a/src/libraries/System.Reflection.Metadata/src/System.Reflection.Metadata.csproj b/src/libraries/System.Reflection.Metadata/src/System.Reflection.Metadata.csproj
index d241f17a26486d..5afd6058e7c826 100644
--- a/src/libraries/System.Reflection.Metadata/src/System.Reflection.Metadata.csproj
+++ b/src/libraries/System.Reflection.Metadata/src/System.Reflection.Metadata.csproj
@@ -5,6 +5,8 @@
en-US
false
true
+ true
+ 1
This package provides a low-level .NET (ECMA-335) metadata reader and writer. It's geared for performance and is the ideal choice for building higher-level libraries that intend to provide their own object model, such as compilers. The metadata format is defined by the ECMA-335 - Common Language Infrastructure (CLI) specification.
The System.Reflection.Metadata library is built-in as part of the shared framework in .NET Runtime. The package can be installed when you need to use it in other target frameworks.
@@ -251,7 +253,7 @@ The System.Reflection.Metadata library is built-in as part of the shared framewo
-
+
@@ -261,6 +263,7 @@ The System.Reflection.Metadata library is built-in as part of the shared framewo
+
diff --git a/src/libraries/System.Reflection.MetadataLoadContext/src/System.Reflection.MetadataLoadContext.csproj b/src/libraries/System.Reflection.MetadataLoadContext/src/System.Reflection.MetadataLoadContext.csproj
index 76d07ddacf18dc..111bd36fc19d4d 100644
--- a/src/libraries/System.Reflection.MetadataLoadContext/src/System.Reflection.MetadataLoadContext.csproj
+++ b/src/libraries/System.Reflection.MetadataLoadContext/src/System.Reflection.MetadataLoadContext.csproj
@@ -5,6 +5,8 @@
true
false
true
+ true
+ 1
Provides read-only reflection on assemblies in an isolated context with support for assemblies that target different processor architectures and runtimes. Using MetadataLoadContext enables you to inspect assemblies without loading them into the main execution context. Assemblies in MetadataLoadContext are treated only as metadata, that is, you can read information about their members, but cannot execute any code contained in them.
@@ -155,8 +157,8 @@
-
-
+
+
diff --git a/src/libraries/System.Runtime.Caching/src/System.Runtime.Caching.csproj b/src/libraries/System.Runtime.Caching/src/System.Runtime.Caching.csproj
index b3d85127f02129..241cbbffb21367 100644
--- a/src/libraries/System.Runtime.Caching/src/System.Runtime.Caching.csproj
+++ b/src/libraries/System.Runtime.Caching/src/System.Runtime.Caching.csproj
@@ -3,6 +3,8 @@
$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent);$(NetCoreAppPrevious)-windows;$(NetCoreAppPrevious);$(NetCoreAppMinimum)-windows;$(NetCoreAppMinimum);netstandard2.0
true
true
+ true
+ 1
true
true
true
diff --git a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/MemoryCache.cs b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/MemoryCache.cs
index e740eed69ed514..38514ce521abca 100644
--- a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/MemoryCache.cs
+++ b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/MemoryCache.cs
@@ -39,7 +39,6 @@ public class MemoryCache : ObjectCache, IEnumerable, IDisposable
private bool _useMemoryCacheManager = true;
private bool _throwOnDisposed;
private EventHandler _onAppDomainUnload;
- private UnhandledExceptionEventHandler _onUnhandledException;
#if NETCOREAPP
[UnsupportedOSPlatformGuard("browser")]
private static bool _countersSupported => !OperatingSystem.IsBrowser();
@@ -219,9 +218,6 @@ private void InitDisposableMembers(NameValueCollection config)
EventHandler onAppDomainUnload = new EventHandler(OnAppDomainUnload);
appDomain.DomainUnload += onAppDomainUnload;
_onAppDomainUnload = onAppDomainUnload;
- UnhandledExceptionEventHandler onUnhandledException = new UnhandledExceptionEventHandler(OnUnhandledException);
- appDomain.UnhandledException += onUnhandledException;
- _onUnhandledException = onUnhandledException;
dispose = false;
}
finally
@@ -238,16 +234,6 @@ private void OnAppDomainUnload(object unusedObject, EventArgs unusedEventArgs)
Dispose();
}
- private void OnUnhandledException(object sender, UnhandledExceptionEventArgs eventArgs)
- {
- // if the CLR is terminating, dispose the cache.
- // This will dispose the perf counters
- if (eventArgs.IsTerminating)
- {
- Dispose();
- }
- }
-
private static void ValidatePolicy(CacheItemPolicy policy)
{
if (policy.AbsoluteExpiration != ObjectCache.InfiniteAbsoluteExpiration
@@ -500,10 +486,6 @@ private void DisposeSafeCritical()
{
appDomain.DomainUnload -= _onAppDomainUnload;
}
- if (_onUnhandledException != null)
- {
- appDomain.UnhandledException -= _onUnhandledException;
- }
}
private object GetInternal(string key, string regionName)
diff --git a/src/libraries/System.Runtime/tests/System/Int32Tests.cs b/src/libraries/System.Runtime/tests/System/Int32Tests.cs
index 0b5f7c8250efe3..4d0dec7e37200f 100644
--- a/src/libraries/System.Runtime/tests/System/Int32Tests.cs
+++ b/src/libraries/System.Runtime/tests/System/Int32Tests.cs
@@ -663,6 +663,46 @@ public static IEnumerable Parse_Invalid_TestData()
yield return new object[] { "2147483649-", NumberStyles.AllowTrailingSign, null, typeof(OverflowException) };
yield return new object[] { "(2147483649)", NumberStyles.AllowParentheses, null, typeof(OverflowException) };
yield return new object[] { "2E10", NumberStyles.AllowExponent, null, typeof(OverflowException) };
+
+ // Test trailing non zeros
+
+ yield return new object[] { "-9223372036854775808.1", NumberStyles.Number, CultureInfo.InvariantCulture, typeof(OverflowException) };
+ yield return new object[] { "-2147483648.1", NumberStyles.Number, CultureInfo.InvariantCulture, typeof(OverflowException) };
+ yield return new object[] { "-32768.1", NumberStyles.Number, CultureInfo.InvariantCulture, typeof(OverflowException) };
+ yield return new object[] { "-128.1", NumberStyles.Number, CultureInfo.InvariantCulture, typeof(OverflowException) };
+ yield return new object[] { "127.1", NumberStyles.Number, CultureInfo.InvariantCulture, typeof(OverflowException) };
+ yield return new object[] { "255.1", NumberStyles.Number, CultureInfo.InvariantCulture, typeof(OverflowException) };
+ yield return new object[] { "32767.1", NumberStyles.Number, CultureInfo.InvariantCulture, typeof(OverflowException) };
+ yield return new object[] { "65535.1", NumberStyles.Number, CultureInfo.InvariantCulture, typeof(OverflowException) };
+ yield return new object[] { "2147483647.1", NumberStyles.Number, CultureInfo.InvariantCulture, typeof(OverflowException) };
+ yield return new object[] { "4294967295.1", NumberStyles.Number, CultureInfo.InvariantCulture, typeof(OverflowException) };
+ yield return new object[] { "9223372036854775807.1", NumberStyles.Number, CultureInfo.InvariantCulture, typeof(OverflowException) };
+ yield return new object[] { "18446744073709551615.1", NumberStyles.Number, CultureInfo.InvariantCulture, typeof(OverflowException) };
+
+ yield return new object[] { "-9223372036854775808.001", NumberStyles.Number, CultureInfo.InvariantCulture, typeof(OverflowException) };
+ yield return new object[] { "-2147483648.001", NumberStyles.Number, CultureInfo.InvariantCulture, typeof(OverflowException) };
+ yield return new object[] { "-32768.001", NumberStyles.Number, CultureInfo.InvariantCulture, typeof(OverflowException) };
+ yield return new object[] { "-128.001", NumberStyles.Number, CultureInfo.InvariantCulture, typeof(OverflowException) };
+ yield return new object[] { "127.001", NumberStyles.Number, CultureInfo.InvariantCulture, typeof(OverflowException) };
+ yield return new object[] { "255.001", NumberStyles.Number, CultureInfo.InvariantCulture, typeof(OverflowException) };
+ yield return new object[] { "32767.001", NumberStyles.Number, CultureInfo.InvariantCulture, typeof(OverflowException) };
+ yield return new object[] { "65535.001", NumberStyles.Number, CultureInfo.InvariantCulture, typeof(OverflowException) };
+ yield return new object[] { "2147483647.001", NumberStyles.Number, CultureInfo.InvariantCulture, typeof(OverflowException) };
+ yield return new object[] { "4294967295.001", NumberStyles.Number, CultureInfo.InvariantCulture, typeof(OverflowException) };
+ yield return new object[] { "9223372036854775807.001", NumberStyles.Number, CultureInfo.InvariantCulture, typeof(OverflowException) };
+ yield return new object[] { "18446744073709551615.001", NumberStyles.Number, CultureInfo.InvariantCulture, typeof(OverflowException) };
+
+ yield return new object[] { "3.001", NumberStyles.Number, CultureInfo.InvariantCulture, typeof(OverflowException) };
+ yield return new object[] { "3.000000001", NumberStyles.Number, CultureInfo.InvariantCulture, typeof(OverflowException) };
+ yield return new object[] { "3.0000000001", NumberStyles.Number, CultureInfo.InvariantCulture, typeof(OverflowException) };
+ yield return new object[] { "3.00000000001", NumberStyles.Number, CultureInfo.InvariantCulture, typeof(OverflowException) };
+
+ yield return new object[] { "3.100", NumberStyles.Number, CultureInfo.InvariantCulture, typeof(OverflowException) };
+ yield return new object[] { "3.100000000", NumberStyles.Number, CultureInfo.InvariantCulture, typeof(OverflowException) };
+ yield return new object[] { "3.1000000000", NumberStyles.Number, CultureInfo.InvariantCulture, typeof(OverflowException) };
+ yield return new object[] { "3.10000000000", NumberStyles.Number, CultureInfo.InvariantCulture, typeof(OverflowException) };
+
+ yield return new object[] { "2147483646.1", NumberStyles.Number, CultureInfo.InvariantCulture, typeof(OverflowException) };
}
[Theory]
diff --git a/src/libraries/System.Security.Cryptography.Cng/tests/RSACngProvider.cs b/src/libraries/System.Security.Cryptography.Cng/tests/RSACngProvider.cs
index d41df34b61404b..025bbc426a4cdf 100644
--- a/src/libraries/System.Security.Cryptography.Cng/tests/RSACngProvider.cs
+++ b/src/libraries/System.Security.Cryptography.Cng/tests/RSACngProvider.cs
@@ -37,6 +37,8 @@ public bool Supports384PrivateKey
public bool SupportsSha1Signatures => true;
+ public bool SupportsMd5Signatures => true;
+
public bool SupportsSha3 { get; } = SHA3_256.IsSupported; // If SHA3_256 is supported, assume 384 and 512 are, too.
}
diff --git a/src/libraries/System.Security.Cryptography.Csp/tests/RSACryptoServiceProviderBackCompat.cs b/src/libraries/System.Security.Cryptography.Csp/tests/RSACryptoServiceProviderBackCompat.cs
index 887bdc3d983e2e..8ef0c9474d73d7 100644
--- a/src/libraries/System.Security.Cryptography.Csp/tests/RSACryptoServiceProviderBackCompat.cs
+++ b/src/libraries/System.Security.Cryptography.Csp/tests/RSACryptoServiceProviderBackCompat.cs
@@ -156,9 +156,12 @@ public static void VerifyLegacySignVerifyHash(bool useLegacySign, bool useLegacy
public static IEnumerable AlgorithmIdentifiers()
{
- yield return new object[] { "MD5", MD5.Create() };
- yield return new object[] { "MD5", typeof(MD5) };
- yield return new object[] { "MD5", "1.2.840.113549.2.5" };
+ if (RSAFactory.SupportsMd5Signatures)
+ {
+ yield return new object[] { "MD5", MD5.Create() };
+ yield return new object[] { "MD5", typeof(MD5) };
+ yield return new object[] { "MD5", "1.2.840.113549.2.5" };
+ }
if (RSAFactory.SupportsSha1Signatures)
{
diff --git a/src/libraries/System.Security.Cryptography.Csp/tests/RSACryptoServiceProviderProvider.cs b/src/libraries/System.Security.Cryptography.Csp/tests/RSACryptoServiceProviderProvider.cs
index 7cd358cd5d1213..fb40b5ece1d0fc 100644
--- a/src/libraries/System.Security.Cryptography.Csp/tests/RSACryptoServiceProviderProvider.cs
+++ b/src/libraries/System.Security.Cryptography.Csp/tests/RSACryptoServiceProviderProvider.cs
@@ -9,6 +9,7 @@ namespace System.Security.Cryptography.Rsa.Tests
public class RSACryptoServiceProviderProvider : IRSAProvider
{
private bool? _supportsSha1Signatures;
+ private bool? _supportsMd5Signatures;
public RSA Create() => new RSACryptoServiceProvider();
@@ -23,6 +24,7 @@ public class RSACryptoServiceProviderProvider : IRSAProvider
public bool SupportsPss => false;
public bool SupportsSha1Signatures => _supportsSha1Signatures ??= SignatureSupport.CanProduceSha1Signature(Create());
+ public bool SupportsMd5Signatures => _supportsMd5Signatures ??= SignatureSupport.CanProduceMd5Signature(Create());
public bool SupportsSha3 => false;
}
diff --git a/src/libraries/System.Security.Cryptography.OpenSsl/tests/EcDsaOpenSslProvider.cs b/src/libraries/System.Security.Cryptography.OpenSsl/tests/EcDsaOpenSslProvider.cs
index aac122ce56d587..4735038ec0184c 100644
--- a/src/libraries/System.Security.Cryptography.OpenSsl/tests/EcDsaOpenSslProvider.cs
+++ b/src/libraries/System.Security.Cryptography.OpenSsl/tests/EcDsaOpenSslProvider.cs
@@ -50,7 +50,7 @@ public bool ExplicitCurvesSupported
{
get
{
- return true;
+ return !PlatformDetection.IsAzureLinux;
}
}
}
diff --git a/src/libraries/System.Security.Cryptography.OpenSsl/tests/RSAOpenSslProvider.cs b/src/libraries/System.Security.Cryptography.OpenSsl/tests/RSAOpenSslProvider.cs
index 0adcda4bfad5ec..18aa9528877d9d 100644
--- a/src/libraries/System.Security.Cryptography.OpenSsl/tests/RSAOpenSslProvider.cs
+++ b/src/libraries/System.Security.Cryptography.OpenSsl/tests/RSAOpenSslProvider.cs
@@ -8,6 +8,7 @@ namespace System.Security.Cryptography.Rsa.Tests
public class RSAOpenSslProvider : IRSAProvider
{
private bool? _supportsSha1Signatures;
+ private bool? _supportsMd5Signatures;
public RSA Create() => new RSAOpenSsl();
@@ -22,6 +23,7 @@ public class RSAOpenSslProvider : IRSAProvider
public bool SupportsPss => true;
public bool SupportsSha1Signatures => _supportsSha1Signatures ??= SignatureSupport.CanProduceSha1Signature(Create());
+ public bool SupportsMd5Signatures => _supportsMd5Signatures ??= SignatureSupport.CanProduceMd5Signature(Create());
public bool SupportsSha3 => SHA3_256.IsSupported; // If SHA3_256 is supported, assume 384 and 512 are, too.
}
diff --git a/src/libraries/System.Security.Cryptography.Pkcs/src/System.Security.Cryptography.Pkcs.csproj b/src/libraries/System.Security.Cryptography.Pkcs/src/System.Security.Cryptography.Pkcs.csproj
index 4988c8cc6a0e99..04b16db1929601 100644
--- a/src/libraries/System.Security.Cryptography.Pkcs/src/System.Security.Cryptography.Pkcs.csproj
+++ b/src/libraries/System.Security.Cryptography.Pkcs/src/System.Security.Cryptography.Pkcs.csproj
@@ -6,6 +6,8 @@
true
$(NoWarn);CA5384
true
+ true
+ 1
Provides support for PKCS and CMS algorithms.
Commonly Used Types:
@@ -650,7 +652,7 @@ System.Security.Cryptography.Pkcs.EnvelopedCms
-
+
diff --git a/src/libraries/System.Security.Cryptography.Pkcs/tests/Pkcs12/KeyBagTests.cs b/src/libraries/System.Security.Cryptography.Pkcs/tests/Pkcs12/KeyBagTests.cs
index 2a3ba970c01aef..071a210c79dd55 100644
--- a/src/libraries/System.Security.Cryptography.Pkcs/tests/Pkcs12/KeyBagTests.cs
+++ b/src/libraries/System.Security.Cryptography.Pkcs/tests/Pkcs12/KeyBagTests.cs
@@ -29,7 +29,7 @@ public static void BuildWithFactoryReadDirect()
Assert.True(rsa2.TrySignData(
keyBag.Pkcs8PrivateKey.Span,
sig,
- HashAlgorithmName.MD5,
+ HashAlgorithmName.SHA256,
RSASignaturePadding.Pkcs1,
out int sigLen));
@@ -38,7 +38,7 @@ public static void BuildWithFactoryReadDirect()
Assert.True(rsa.VerifyData(
keyBag.Pkcs8PrivateKey.Span,
sig,
- HashAlgorithmName.MD5,
+ HashAlgorithmName.SHA256,
RSASignaturePadding.Pkcs1));
}
}
diff --git a/src/libraries/System.Security.Cryptography.Pkcs/tests/Pkcs12/ShroudedKeyBagTests.cs b/src/libraries/System.Security.Cryptography.Pkcs/tests/Pkcs12/ShroudedKeyBagTests.cs
index b2141a822c218e..aebe413b357633 100644
--- a/src/libraries/System.Security.Cryptography.Pkcs/tests/Pkcs12/ShroudedKeyBagTests.cs
+++ b/src/libraries/System.Security.Cryptography.Pkcs/tests/Pkcs12/ShroudedKeyBagTests.cs
@@ -40,7 +40,7 @@ public static void BuildWithCharsFactoryReadDirect()
Assert.True(rsa2.TrySignData(
keyBag.EncryptedPkcs8PrivateKey.Span,
sig,
- HashAlgorithmName.MD5,
+ HashAlgorithmName.SHA256,
RSASignaturePadding.Pkcs1,
out int sigLen));
@@ -49,7 +49,7 @@ public static void BuildWithCharsFactoryReadDirect()
Assert.True(rsa.VerifyData(
keyBag.EncryptedPkcs8PrivateKey.Span,
sig,
- HashAlgorithmName.MD5,
+ HashAlgorithmName.SHA256,
RSASignaturePadding.Pkcs1));
}
}
@@ -77,7 +77,7 @@ public static void BuildWithBytesFactoryReadDirect()
Assert.True(rsa2.TrySignData(
keyBag.EncryptedPkcs8PrivateKey.Span,
sig,
- HashAlgorithmName.MD5,
+ HashAlgorithmName.SHA256,
RSASignaturePadding.Pkcs1,
out int sigLen));
@@ -86,7 +86,7 @@ public static void BuildWithBytesFactoryReadDirect()
Assert.True(rsa.VerifyData(
keyBag.EncryptedPkcs8PrivateKey.Span,
sig,
- HashAlgorithmName.MD5,
+ HashAlgorithmName.SHA256,
RSASignaturePadding.Pkcs1));
}
}
diff --git a/src/libraries/System.Security.Cryptography.Pkcs/tests/SignatureSupport.cs b/src/libraries/System.Security.Cryptography.Pkcs/tests/SignatureSupport.cs
index ee31485341cab3..5e317d841cfc48 100644
--- a/src/libraries/System.Security.Cryptography.Pkcs/tests/SignatureSupport.cs
+++ b/src/libraries/System.Security.Cryptography.Pkcs/tests/SignatureSupport.cs
@@ -10,5 +10,8 @@ public class SignatureSupport
{
public static bool SupportsRsaSha1Signatures { get; } =
System.Security.Cryptography.Tests.SignatureSupport.CanProduceSha1Signature(RSA.Create());
+
+ public static bool SupportsRsaMd5Signatures { get; } =
+ System.Security.Cryptography.Tests.SignatureSupport.CanProduceMd5Signature(RSA.Create());
}
}
diff --git a/src/libraries/System.Security.Cryptography.Pkcs/tests/SignedCms/SignerInfoTests.cs b/src/libraries/System.Security.Cryptography.Pkcs/tests/SignedCms/SignerInfoTests.cs
index 10a51fc819545a..c3ff48deb9eb85 100644
--- a/src/libraries/System.Security.Cryptography.Pkcs/tests/SignedCms/SignerInfoTests.cs
+++ b/src/libraries/System.Security.Cryptography.Pkcs/tests/SignedCms/SignerInfoTests.cs
@@ -198,7 +198,7 @@ public static void CheckSignature_ExtraStore_IsAdditional()
signer.CheckSignature(new X509Certificate2Collection(), true);
}
- [Fact]
+ [ConditionalFact(typeof(SignatureSupport), nameof(SignatureSupport.SupportsRsaMd5Signatures))]
public static void CheckSignature_MD5WithRSA()
{
SignedCms cms = new SignedCms();
diff --git a/src/libraries/System.Security.Cryptography.Xml/src/System.Security.Cryptography.Xml.csproj b/src/libraries/System.Security.Cryptography.Xml/src/System.Security.Cryptography.Xml.csproj
index 398bd5ad04ef4b..381297c2a4b799 100644
--- a/src/libraries/System.Security.Cryptography.Xml/src/System.Security.Cryptography.Xml.csproj
+++ b/src/libraries/System.Security.Cryptography.Xml/src/System.Security.Cryptography.Xml.csproj
@@ -4,8 +4,8 @@
true
$(NoWarn);CA1850
true
- false
- 1
+ true
+ 2
Provides classes to support the creation and validation of XML digital signatures. The classes in this namespace implement the World Wide Web Consortium Recommendation, "XML-Signature Syntax and Processing", described at http://www.w3.org/TR/xmldsig-core/.
Commonly Used Types:
diff --git a/src/libraries/System.Security.Cryptography/tests/ChaCha20Poly1305Tests.cs b/src/libraries/System.Security.Cryptography/tests/ChaCha20Poly1305Tests.cs
index ced6edcf350951..24ec6ffbc99fc6 100644
--- a/src/libraries/System.Security.Cryptography/tests/ChaCha20Poly1305Tests.cs
+++ b/src/libraries/System.Security.Cryptography/tests/ChaCha20Poly1305Tests.cs
@@ -478,6 +478,11 @@ public static void CheckIsSupported()
// CryptoKit is supported on macOS 10.15+, which is our minimum target.
expectedIsSupported = true;
}
+ else if (PlatformDetection.IsAzureLinux)
+ {
+ // Though Azure Linux uses OpenSSL, they build OpenSSL without ChaCha20-Poly1305.
+ expectedIsSupported = false;
+ }
else if (PlatformDetection.OpenSslPresentOnSystem && PlatformDetection.IsOpenSslSupported)
{
const int OpenSslChaChaMinimumVersion = 0x1_01_00_00_F; //major_minor_fix_patch_status
diff --git a/src/libraries/System.Security.Cryptography/tests/DefaultECDiffieHellmanProvider.Unix.cs b/src/libraries/System.Security.Cryptography/tests/DefaultECDiffieHellmanProvider.Unix.cs
index 162831d72ac696..b1c51483231ddb 100644
--- a/src/libraries/System.Security.Cryptography/tests/DefaultECDiffieHellmanProvider.Unix.cs
+++ b/src/libraries/System.Security.Cryptography/tests/DefaultECDiffieHellmanProvider.Unix.cs
@@ -25,7 +25,7 @@ public bool ExplicitCurvesSupported
{
get
{
- if (PlatformDetection.IsOSXLike)
+ if (PlatformDetection.IsOSXLike || PlatformDetection.IsAzureLinux)
{
return false;
}
diff --git a/src/libraries/System.Security.Cryptography/tests/DefaultECDsaProvider.Unix.cs b/src/libraries/System.Security.Cryptography/tests/DefaultECDsaProvider.Unix.cs
index 53e9198720360b..5ade1828c02774 100644
--- a/src/libraries/System.Security.Cryptography/tests/DefaultECDsaProvider.Unix.cs
+++ b/src/libraries/System.Security.Cryptography/tests/DefaultECDsaProvider.Unix.cs
@@ -25,7 +25,7 @@ public bool ExplicitCurvesSupported
{
get
{
- if (PlatformDetection.IsOSXLike)
+ if (PlatformDetection.IsOSXLike || PlatformDetection.IsAzureLinux)
{
return false;
}
diff --git a/src/libraries/System.Security.Cryptography/tests/DefaultRSAProvider.cs b/src/libraries/System.Security.Cryptography/tests/DefaultRSAProvider.cs
index c65b78ace1288e..d6883088f06f24 100644
--- a/src/libraries/System.Security.Cryptography/tests/DefaultRSAProvider.cs
+++ b/src/libraries/System.Security.Cryptography/tests/DefaultRSAProvider.cs
@@ -10,6 +10,7 @@ public class DefaultRSAProvider : IRSAProvider
{
private bool? _supports384PrivateKey;
private bool? _supportsSha1Signatures;
+ private bool? _supportsMd5Signatures;
public RSA Create() => RSA.Create();
@@ -41,6 +42,7 @@ public bool Supports384PrivateKey
}
public bool SupportsSha1Signatures => _supportsSha1Signatures ??= SignatureSupport.CanProduceSha1Signature(Create());
+ public bool SupportsMd5Signatures => _supportsMd5Signatures ??= SignatureSupport.CanProduceMd5Signature(Create());
public bool SupportsLargeExponent => true;
diff --git a/src/libraries/System.Security.Cryptography/tests/HKDFTests.cs b/src/libraries/System.Security.Cryptography/tests/HKDFTests.cs
index 6f58c00e80994c..9c3537808b0a70 100644
--- a/src/libraries/System.Security.Cryptography/tests/HKDFTests.cs
+++ b/src/libraries/System.Security.Cryptography/tests/HKDFTests.cs
@@ -14,6 +14,8 @@ public abstract class HKDFTests
protected abstract byte[] Expand(HashAlgorithmName hash, byte[] prk, int outputLength, byte[] info);
protected abstract byte[] DeriveKey(HashAlgorithmName hash, byte[] ikm, int outputLength, byte[] salt, byte[] info);
+ internal static bool MD5Supported => !PlatformDetection.IsBrowser && !PlatformDetection.IsAzureLinux;
+
[Theory]
[MemberData(nameof(GetHkdfTestCases))]
public void ExtractTests(HkdfTestCase test)
@@ -22,9 +24,8 @@ public void ExtractTests(HkdfTestCase test)
Assert.Equal(test.Prk, prk);
}
- [Theory]
+ [ConditionalTheory(nameof(MD5Supported))]
[MemberData(nameof(GetHkdfTestCases))]
- [SkipOnPlatform(TestPlatforms.Browser, "MD5 is not supported on Browser")]
public void ExtractTamperHashTests(HkdfTestCase test)
{
byte[] prk = Extract(HashAlgorithmName.MD5, 128 / 8, test.Ikm, test.Salt);
@@ -257,7 +258,7 @@ public static IEnumerable GetPrkTooShortTestCases()
yield return new object[] { HashAlgorithmName.SHA256, 256 / 8 - 1 };
yield return new object[] { HashAlgorithmName.SHA512, 512 / 8 - 1 };
- if (!PlatformDetection.IsBrowser)
+ if (MD5Supported)
{
yield return new object[] { HashAlgorithmName.MD5, 128 / 8 - 1 };
}
diff --git a/src/libraries/System.Security.Cryptography/tests/HmacMD5Tests.cs b/src/libraries/System.Security.Cryptography/tests/HmacMD5Tests.cs
index 2adf417aec8458..fa18da8e11cbde 100644
--- a/src/libraries/System.Security.Cryptography/tests/HmacMD5Tests.cs
+++ b/src/libraries/System.Security.Cryptography/tests/HmacMD5Tests.cs
@@ -9,12 +9,12 @@
namespace System.Security.Cryptography.Tests
{
- [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")]
+ [ConditionalClass(typeof(HmacMD5Tests.Traits), nameof(HmacMD5Tests.Traits.IsSupported))]
public class HmacMD5Tests : Rfc2202HmacTests
{
public sealed class Traits : IHmacTrait
{
- public static bool IsSupported => true;
+ public static bool IsSupported => !PlatformDetection.IsAzureLinux && !PlatformDetection.IsBrowser;
public static int HashSizeInBytes => HMACSHA1.HashSizeInBytes;
}
diff --git a/src/libraries/System.ServiceProcess.ServiceController/src/System.ServiceProcess.ServiceController.csproj b/src/libraries/System.ServiceProcess.ServiceController/src/System.ServiceProcess.ServiceController.csproj
index fec4052c5c0374..9406ea37a3b6ec 100644
--- a/src/libraries/System.ServiceProcess.ServiceController/src/System.ServiceProcess.ServiceController.csproj
+++ b/src/libraries/System.ServiceProcess.ServiceController/src/System.ServiceProcess.ServiceController.csproj
@@ -4,6 +4,8 @@
true
$(NoWarn);CA2249
true
+ true
+ 1
Provides the System.ServiceProcess.ServiceController class, which allows you to connect to a Windows service, manipulate it, or get information about it.
Commonly Used Types:
diff --git a/src/libraries/System.Text.Json/src/System.Text.Json.csproj b/src/libraries/System.Text.Json/src/System.Text.Json.csproj
index 7e73fd3b12a50b..45ceafbf34daf9 100644
--- a/src/libraries/System.Text.Json/src/System.Text.Json.csproj
+++ b/src/libraries/System.Text.Json/src/System.Text.Json.csproj
@@ -8,8 +8,8 @@
CS8969
true
true
- false
- 4
+ true
+ 5
Provides high-performance and low-allocating types that serialize objects to JavaScript Object Notation (JSON) text and deserialize JSON text to objects, with UTF-8 support built-in. Also provides types to read and write JSON text encoded as UTF-8, and to create an in-memory document object model (DOM), that is read-only, for random access of the JSON elements within a structured view of the data.
The System.Text.Json library is built-in as part of the shared framework in .NET Runtime. The package can be installed when you need to use it in other target frameworks.
@@ -381,7 +381,7 @@ The System.Text.Json library is built-in as part of the shared framework in .NET
-
+
@@ -398,6 +398,7 @@ The System.Text.Json library is built-in as part of the shared framework in .NET
+
diff --git a/src/mono/mono/mini/mini-llvm.c b/src/mono/mono/mini/mini-llvm.c
index 657bb23d5cf63d..668b2c2ed53e12 100644
--- a/src/mono/mono/mini/mini-llvm.c
+++ b/src/mono/mono/mini/mini-llvm.c
@@ -1557,7 +1557,7 @@ sig_to_llvm_sig_full (EmitContext *ctx, MonoMethodSignature *sig, LLVMCallInfo *
ret_type = LLVMStructType (members, 1, FALSE);
} else if (cinfo->ret.pair_storage [0] == LLVMArgNone && cinfo->ret.pair_storage [1] == LLVMArgNone) {
/* Empty struct */
- ret_type = LLVMVoidType ();
+ ret_type = LLVMStructType (NULL, 0, FALSE);
} else if (cinfo->ret.pair_storage [0] == LLVMArgInIReg && cinfo->ret.pair_storage [1] == LLVMArgInIReg) {
LLVMTypeRef members [2];
@@ -1574,7 +1574,11 @@ sig_to_llvm_sig_full (EmitContext *ctx, MonoMethodSignature *sig, LLVMCallInfo *
case LLVMArgVtypeAsScalar: {
int size = mono_class_value_size (mono_class_from_mono_type_internal (rtype), NULL);
/* LLVM models this by returning an int */
- if (size < TARGET_SIZEOF_VOID_P) {
+ if (size == 0) {
+ /* Empty struct with LayoutKind attribute and without specified size */
+ g_assert(cinfo->ret.nslots == 0);
+ ret_type = LLVMIntType (8);
+ } else if (size < TARGET_SIZEOF_VOID_P) {
g_assert (cinfo->ret.nslots == 1);
ret_type = LLVMIntType (size * 8);
} else {
@@ -4806,6 +4810,9 @@ process_call (EmitContext *ctx, MonoBasicBlock *bb, LLVMBuilderRef *builder_ref,
/* Empty struct */
break;
+ if (LLVMTypeOf (lcall) == LLVMStructType (NULL, 0, FALSE))
+ break;
+
if (!addresses [ins->dreg])
addresses [ins->dreg] = build_alloca_address (ctx, sig->ret);
diff --git a/src/native/libs/System.Security.Cryptography.Native.Apple/pal_x509_macos.c b/src/native/libs/System.Security.Cryptography.Native.Apple/pal_x509_macos.c
index 41ba9648259c76..fc261117a1588b 100644
--- a/src/native/libs/System.Security.Cryptography.Native.Apple/pal_x509_macos.c
+++ b/src/native/libs/System.Security.Cryptography.Native.Apple/pal_x509_macos.c
@@ -391,7 +391,7 @@ int32_t AppleCryptoNative_X509CopyWithPrivateKey(SecCertificateRef cert,
SecKeychainItemRef itemCopy = NULL;
// This only happens with an ephemeral key, so the keychain we're adding it to is temporary.
- if (status == errSecNoSuchKeychain)
+ if (status == errSecNoSuchKeychain || status == errSecInvalidItemRef)
{
status = AddKeyToKeychain(privateKey, targetKeychain, NULL);
}
diff --git a/src/tests/JIT/Regression/JitBlue/Runtime_103628/Runtime_103628.cs b/src/tests/JIT/Regression/JitBlue/Runtime_103628/Runtime_103628.cs
new file mode 100644
index 00000000000000..ef904b9699168a
--- /dev/null
+++ b/src/tests/JIT/Regression/JitBlue/Runtime_103628/Runtime_103628.cs
@@ -0,0 +1,29 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+using System.Runtime.InteropServices;
+using Xunit;
+
+[StructLayout(LayoutKind.Sequential)]
+public struct S1
+{
+}
+
+[StructLayout(LayoutKind.Auto)]
+public struct S2
+{
+}
+
+public class Runtime_103628
+{
+ public static S1 Get_S1() => new S1();
+
+ public static S2 Get_S2() => new S2();
+
+ [Fact]
+ public static void TestEntryPoint()
+ {
+ S1 s1 = Get_S1();
+ S2 s2 = Get_S2();
+ }
+}
diff --git a/src/tests/JIT/Regression/JitBlue/Runtime_103628/Runtime_103628.csproj b/src/tests/JIT/Regression/JitBlue/Runtime_103628/Runtime_103628.csproj
new file mode 100644
index 00000000000000..de6d5e08882e86
--- /dev/null
+++ b/src/tests/JIT/Regression/JitBlue/Runtime_103628/Runtime_103628.csproj
@@ -0,0 +1,8 @@
+
+
+ True
+
+
+
+
+
diff --git a/src/tests/JIT/Regression/JitBlue/Runtime_106607/Runtime_106607.il b/src/tests/JIT/Regression/JitBlue/Runtime_106607/Runtime_106607.il
new file mode 100644
index 00000000000000..8eba69b7303605
--- /dev/null
+++ b/src/tests/JIT/Regression/JitBlue/Runtime_106607/Runtime_106607.il
@@ -0,0 +1,40 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+.assembly extern System.Runtime { }
+.assembly extern System.Console { }
+.assembly extern xunit.core { }
+.assembly Runtime_106607 { }
+
+.class Runtime_106607 extends [System.Runtime]System.Object
+{
+ .method public static int32 Main() nooptimization
+ {
+ .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = (
+ 01 00 00 00
+ )
+ .entrypoint
+ .maxstack 8
+ .locals init ([0] int32 num)
+
+ ldc.i4 42
+ stloc.0
+ ldloc.0
+ ldc.i4 1620763441
+ ldc.i4 1453536392
+ add
+ add
+ ldloc.0
+ ldloc.0
+ sub
+ ldc.i4 152872638
+ ldc.i4.s 31
+ and
+ shl
+ add
+ call void [System.Console]System.Console::WriteLine(int32)
+
+ ldc.i4 100
+ ret
+ }
+}
diff --git a/src/tests/JIT/Regression/JitBlue/Runtime_106607/Runtime_106607.ilproj b/src/tests/JIT/Regression/JitBlue/Runtime_106607/Runtime_106607.ilproj
new file mode 100644
index 00000000000000..4b3a54c1abb8a4
--- /dev/null
+++ b/src/tests/JIT/Regression/JitBlue/Runtime_106607/Runtime_106607.ilproj
@@ -0,0 +1,9 @@
+
+
+ None
+ True
+
+
+
+
+
diff --git a/src/tests/JIT/Regression/JitBlue/Runtime_99391/Runtime_99391.cs b/src/tests/JIT/Regression/JitBlue/Runtime_99391/Runtime_99391.cs
new file mode 100644
index 00000000000000..6033a74cdd6645
--- /dev/null
+++ b/src/tests/JIT/Regression/JitBlue/Runtime_99391/Runtime_99391.cs
@@ -0,0 +1,50 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+using System;
+using System.Runtime.CompilerServices;
+using System.Numerics;
+using Xunit;
+
+public class Runtime_99391
+{
+ [Fact]
+ public static void TestEntryPoint()
+ {
+ Vector2 result2a = Vector2.Normalize(Value2);
+ Assert.Equal(new Vector2(0, 1), result2a);
+
+ Vector2 result2b = Vector2.Normalize(new Vector2(0, 2));
+ Assert.Equal(new Vector2(0, 1), result2b);
+
+ Vector3 result3a = Vector3.Normalize(Value3);
+ Assert.Equal(new Vector3(0, 0, 1), result3a);
+
+ Vector3 result3b = Vector3.Normalize(new Vector3(0, 0, 2));
+ Assert.Equal(new Vector3(0, 0, 1), result3b);
+
+ Vector4 result4a = Vector4.Normalize(Value4);
+ Assert.Equal(new Vector4(0, 0, 0, 1), result4a);
+
+ Vector4 result4b = Vector4.Normalize(new Vector4(0, 0, 0, 2));
+ Assert.Equal(new Vector4(0, 0, 0, 1), result4b);
+ }
+
+ private static Vector2 Value2
+ {
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ get => new Vector2(0, 2);
+ }
+
+ private static Vector3 Value3
+ {
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ get => new Vector3(0, 0, 2);
+ }
+
+ private static Vector4 Value4
+ {
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ get => new Vector4(0, 0, 0, 2);
+ }
+}
diff --git a/src/tests/JIT/Regression/JitBlue/Runtime_99391/Runtime_99391.csproj b/src/tests/JIT/Regression/JitBlue/Runtime_99391/Runtime_99391.csproj
new file mode 100644
index 00000000000000..efa9e9b022442a
--- /dev/null
+++ b/src/tests/JIT/Regression/JitBlue/Runtime_99391/Runtime_99391.csproj
@@ -0,0 +1,11 @@
+
+
+ True
+
+
+
+
+
+
+
+