diff --git a/eng/pipelines/common/templates/runtimes/build-test-job.yml b/eng/pipelines/common/templates/runtimes/build-test-job.yml
index 562b426eebc1fd..3228c264bceb71 100644
--- a/eng/pipelines/common/templates/runtimes/build-test-job.yml
+++ b/eng/pipelines/common/templates/runtimes/build-test-job.yml
@@ -28,12 +28,6 @@ parameters:
### Build managed test components (native components are getting built as part
### of the the product build job).
-### TODO: As of today, build of managed test components requires the product build
-### as a prerequisite due to dependency on System.Private.Corelib. After switching
-### over to its reference assembly we should be able to remove this dependency and
-### run managed test builds in parallel with the product build job.
-
-
jobs:
- template: /eng/pipelines/${{ parameters.runtimeFlavor }}/templates/xplat-pipeline-job.yml
parameters:
@@ -48,10 +42,7 @@ jobs:
liveLibrariesBuildConfig: ${{ parameters.liveLibrariesBuildConfig }}
pool: ${{ parameters.pool }}
dependOnEvaluatePaths: ${{ parameters.dependOnEvaluatePaths }}
- ${{ if eq(parameters.runtimeFlavor, 'coreclr') }}:
- liveRuntimeBuildParams: ${{ format('clr.corelib+libs.ref+libs.native -rc {0} -c {1} -arch {2} -ci', coalesce(parameters.liveRuntimeBuildConfig, parameters.buildConfig), parameters.liveLibrariesBuildConfig, parameters.archType) }}
- ${{ if eq(parameters.runtimeFlavor, 'mono') }}:
- liveRuntimeBuildParams: ${{ format('mono.corelib+libs.ref+libs.native -rc {0} -c {1} -arch {2} -ci', coalesce(parameters.liveRuntimeBuildConfig, parameters.buildConfig), parameters.liveLibrariesBuildConfig, parameters.archType) }}
+ liveRuntimeBuildParams: ${{ format('libs.ref+libs.native -c {0} -arch {1} -ci', parameters.liveLibrariesBuildConfig, parameters.archType) }}
${{ if and(ne(parameters.osGroup, 'windows'), ne(parameters.compilerName, 'gcc'), not(and(eq(parameters.osGroup, 'Linux'), eq(parameters.osSubgroup, '_musl'), eq(parameters.archType, 'x64'))), not(eq(parameters.osGroup, 'OSX'))) }}:
compilerArg: '-clang9'
@@ -84,14 +75,8 @@ jobs:
timeoutInMinutes: 160
variables:
- - ${{ each variable in parameters.variables }}:
- - ${{ variable }}
- - ${{ if eq(parameters.runtimeFlavor, 'coreclr') }}:
- - name: liveRuntimeBuildParams
- value: ${{ format('clr.corelib+libs.ref+libs.native -rc {0} -c {1} -arch {2} -ci', coalesce(parameters.liveRuntimeBuildConfig, parameters.buildConfig), parameters.liveLibrariesBuildConfig, parameters.archType) }}
- - ${{ if eq(parameters.runtimeFlavor, 'mono') }}:
- - name: liveRuntimeBuildParams
- value: ${{ format('mono.corelib+libs.ref+libs.native -rc {0} -c {1} -arch {2} -ci', coalesce(parameters.liveRuntimeBuildConfig, parameters.buildConfig), parameters.liveLibrariesBuildConfig, parameters.archType) }}
+ - name: liveRuntimeBuildParams
+ value: ${{ format('libs.ref+libs.native -c {0} -arch {1} -ci', parameters.liveLibrariesBuildConfig, parameters.archType) }}
- name: compilerArg
value: ''
- ${{ if and(ne(parameters.osGroup, 'windows'), ne(parameters.compilerName, 'gcc')) }}:
diff --git a/src/coreclr/System.Private.CoreLib/src/Internal/Runtime/InteropServices/ComActivator.cs b/src/coreclr/System.Private.CoreLib/src/Internal/Runtime/InteropServices/ComActivator.cs
index a00ecd1b6196b0..dcc279db859893 100644
--- a/src/coreclr/System.Private.CoreLib/src/Internal/Runtime/InteropServices/ComActivator.cs
+++ b/src/coreclr/System.Private.CoreLib/src/Internal/Runtime/InteropServices/ComActivator.cs
@@ -60,8 +60,7 @@ void CreateInstanceLic(
public partial struct ComActivationContext
{
[RequiresUnreferencedCode("Built-in COM support is not trim compatible", Url = "https://aka.ms/dotnet-illink/com")]
- [CLSCompliant(false)]
- public static unsafe ComActivationContext Create(ref ComActivationContextInternal cxtInt)
+ internal static unsafe ComActivationContext Create(ref ComActivationContextInternal cxtInt)
{
if (!Marshal.IsBuiltInComSupported)
{
diff --git a/src/libraries/System.Runtime.Internal/Directory.Build.props b/src/libraries/System.Runtime.Internal/Directory.Build.props
new file mode 100644
index 00000000000000..e8d65546d0c807
--- /dev/null
+++ b/src/libraries/System.Runtime.Internal/Directory.Build.props
@@ -0,0 +1,6 @@
+
+
+
+ Microsoft
+
+
diff --git a/src/libraries/System.Runtime.Internal/Directory.Build.targets b/src/libraries/System.Runtime.Internal/Directory.Build.targets
new file mode 100644
index 00000000000000..e24e1b0f0931f1
--- /dev/null
+++ b/src/libraries/System.Runtime.Internal/Directory.Build.targets
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
diff --git a/src/libraries/System.Runtime.Internal/README.md b/src/libraries/System.Runtime.Internal/README.md
new file mode 100644
index 00000000000000..d3ccc259d9517b
--- /dev/null
+++ b/src/libraries/System.Runtime.Internal/README.md
@@ -0,0 +1,3 @@
+# System.Runtime.Internal
+
+The System.Runtime.Internal library is designed for internal usage in our test tree. This library exposes some public APIs from System.Private.CoreLib for usage in our tests that are not exposed via the Microsoft.NETCore.App framework. These API are either used by the hosting layer (so they don't need to be exposed publicly) or used by some old internal tooling that we're working to remove in future versions of .NET.
diff --git a/src/libraries/System.Runtime.Internal/System.Runtime.Internal.sln b/src/libraries/System.Runtime.Internal/System.Runtime.Internal.sln
new file mode 100644
index 00000000000000..77580d36043a2d
--- /dev/null
+++ b/src/libraries/System.Runtime.Internal/System.Runtime.Internal.sln
@@ -0,0 +1,33 @@
+Microsoft Visual Studio Solution File, Format Version 12.00
+#
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Runtime", "ref\System.Runtime.Internal.csproj", "{F39E2C7E-5FE1-460C-AC2C-7E2B50955F2C}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ref", "ref", "{D00764F9-F736-4072-A7DD-B4BF05CF4786}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Runtime.Internal", "src\System.Runtime.Internal.csproj", "{215536A6-ECCE-4AF9-B108-8ED370095D78}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {F39E2C7E-5FE1-460C-AC2C-7E2B50955F2C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {F39E2C7E-5FE1-460C-AC2C-7E2B50955F2C}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {F39E2C7E-5FE1-460C-AC2C-7E2B50955F2C}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {F39E2C7E-5FE1-460C-AC2C-7E2B50955F2C}.Release|Any CPU.Build.0 = Release|Any CPU
+ {215536A6-ECCE-4AF9-B108-8ED370095D78}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {215536A6-ECCE-4AF9-B108-8ED370095D78}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {215536A6-ECCE-4AF9-B108-8ED370095D78}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {215536A6-ECCE-4AF9-B108-8ED370095D78}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(NestedProjects) = preSolution
+ {F39E2C7E-5FE1-460C-AC2C-7E2B50955F2C} = {D00764F9-F736-4072-A7DD-B4BF05CF4786}
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {19706846-1F47-42ED-B649-B0982EE96E6B}
+ EndGlobalSection
+EndGlobal
diff --git a/src/libraries/System.Runtime.Internal/ref/System.Runtime.Internal.cs b/src/libraries/System.Runtime.Internal/ref/System.Runtime.Internal.cs
new file mode 100644
index 00000000000000..daf9834dfc1f09
--- /dev/null
+++ b/src/libraries/System.Runtime.Internal/ref/System.Runtime.Internal.cs
@@ -0,0 +1,54 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// ------------------------------------------------------------------------------
+// Changes to this file must follow the https://aka.ms/api-review process.
+// ------------------------------------------------------------------------------
+namespace Internal.Runtime.InteropServices
+{
+ [System.Runtime.Versioning.SupportedOSPlatform("windows")]
+ public static class ComActivator
+ {
+ //
+ // Summary:
+ // Entry point for unmanaged COM register/unregister API from managed code
+ //
+ // Parameters:
+ // cxt:
+ // Reference to a Internal.Runtime.InteropServices.ComActivationContext instance
+ //
+ // register:
+ // true if called for register or false to indicate unregister
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Built-in COM support is not trim compatible", Url = "https://aka.ms/dotnet-illink/com")]
+ public static void ClassRegistrationScenarioForType(ComActivationContext cxt, bool register) {}
+ //
+ // Summary:
+ // Entry point for unmanaged COM activation API from managed code
+ //
+ // Parameters:
+ // cxt:
+ // Reference to a Internal.Runtime.InteropServices.ComActivationContext instance
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Built-in COM support is not trim compatible", Url = "https://aka.ms/dotnet-illink/com")]
+ public static object GetClassFactoryForType(ComActivationContext cxt) => throw null;
+ }
+ public struct ComActivationContext
+ {
+ public System.Guid ClassId;
+ public System.Guid InterfaceId;
+ public string AssemblyPath;
+ public string AssemblyName;
+ public string TypeName;
+ }
+ public static class InMemoryAssemblyLoader
+ {
+ public static unsafe void LoadInMemoryAssembly(System.IntPtr moduleHandle, System.IntPtr assemblyPath) => throw null;
+ }
+}
+
+namespace System.Runtime.CompilerServices
+{
+ public interface ICastable
+ {
+ bool IsInstanceOfInterface(RuntimeTypeHandle interfaceType, [System.Diagnostics.CodeAnalysis.NotNullWhen(true)] out Exception? castError);
+ RuntimeTypeHandle GetImplType(RuntimeTypeHandle interfaceType);
+ }
+}
diff --git a/src/libraries/System.Runtime.Internal/ref/System.Runtime.Internal.csproj b/src/libraries/System.Runtime.Internal/ref/System.Runtime.Internal.csproj
new file mode 100644
index 00000000000000..a6eed9b76175f5
--- /dev/null
+++ b/src/libraries/System.Runtime.Internal/ref/System.Runtime.Internal.csproj
@@ -0,0 +1,14 @@
+
+
+ System.Runtime.Internal
+ true
+ $(NetCoreAppCurrent)
+ enable
+
+
+
+
+
+
+
+
diff --git a/src/libraries/System.Runtime.Internal/src/MatchingRefApiCompatBaseline.txt b/src/libraries/System.Runtime.Internal/src/MatchingRefApiCompatBaseline.txt
new file mode 100644
index 00000000000000..9ea4737d09ea56
--- /dev/null
+++ b/src/libraries/System.Runtime.Internal/src/MatchingRefApiCompatBaseline.txt
@@ -0,0 +1,4 @@
+# APIs that we don't need to expose since they're [UnmanagedCallersOnly]
+MembersMustExist : Member 'public System.Int32 Internal.Runtime.InteropServices.ComActivator.GetClassFactoryForTypeInternal(Internal.Runtime.InteropServices.ComActivationContextInternal*)' does not exist in the reference but it does exist in the implementation.
+MembersMustExist : Member 'public System.Int32 Internal.Runtime.InteropServices.ComActivator.RegisterClassForTypeInternal(Internal.Runtime.InteropServices.ComActivationContextInternal*)' does not exist in the reference but it does exist in the implementation.
+MembersMustExist : Member 'public System.Int32 Internal.Runtime.InteropServices.ComActivator.UnregisterClassForTypeInternal(Internal.Runtime.InteropServices.ComActivationContextInternal*)' does not exist in the reference but it does exist in the implementation.
diff --git a/src/libraries/System.Runtime.Internal/src/Resources/Strings.resx b/src/libraries/System.Runtime.Internal/src/Resources/Strings.resx
new file mode 100644
index 00000000000000..70880515d4bc60
--- /dev/null
+++ b/src/libraries/System.Runtime.Internal/src/Resources/Strings.resx
@@ -0,0 +1,63 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Private.CoreLib Internal APIs are not supported.
+
+
diff --git a/src/libraries/System.Runtime.Internal/src/System.Runtime.Internal.csproj b/src/libraries/System.Runtime.Internal/src/System.Runtime.Internal.csproj
new file mode 100644
index 00000000000000..28658394d0f3cf
--- /dev/null
+++ b/src/libraries/System.Runtime.Internal/src/System.Runtime.Internal.csproj
@@ -0,0 +1,13 @@
+
+
+ true
+ enable
+ $(NetCoreAppCurrent)
+ true
+ SR.PlatformNotSupported_System_Runtime_Internal
+ true
+
+
+
+
+
diff --git a/src/libraries/System.Runtime.Internal/tests/System.Runtime.Experimental.Tests.csproj b/src/libraries/System.Runtime.Internal/tests/System.Runtime.Experimental.Tests.csproj
new file mode 100644
index 00000000000000..d8ed841331b0f3
--- /dev/null
+++ b/src/libraries/System.Runtime.Internal/tests/System.Runtime.Experimental.Tests.csproj
@@ -0,0 +1,55 @@
+
+
+ true
+ true
+ $(NoWarn),1718,SYSLIB0013
+ true
+ true
+ $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser
+ disable
+
+ $(Features.Replace('nullablePublicOnly', '')
+
+
+ $(DefineConstants);FEATURE_GENERIC_MATH
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/tests/Common/override.targets b/src/tests/Common/override.targets
deleted file mode 100644
index 0586ffe389928b..00000000000000
--- a/src/tests/Common/override.targets
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/tests/Directory.Build.targets b/src/tests/Directory.Build.targets
index 0c52df3659e907..d7ee82760d8288 100644
--- a/src/tests/Directory.Build.targets
+++ b/src/tests/Directory.Build.targets
@@ -80,7 +80,6 @@
<_WillCLRTestProjectBuild Condition="'$(BuildAllProjects)' != 'true'">true
<_WillCLRTestProjectBuild Condition="'$(BuildAllProjects)' == 'true' And '$(CLRTestPriority)' <= '$(CLRTestPriorityToBuild)'">true
<_WillCLRTestProjectBuild Condition="'$(CLRTestBuildAllTargets)' != 'allTargets' And '$(CLRTestTargetUnsupported)' == 'true'">false
- <_WillCLRTestProjectBuild Condition="'$(ReferenceSystemPrivateCoreLib)' == 'true' and '$(RuntimeFlavor)' == 'mono'">false
<_WillCLRTestProjectBuild Condition="'$(DisableProjectBuild)' == 'true'">false
@@ -95,8 +94,6 @@
-
-
@@ -225,12 +222,11 @@
BeforeTargets="BeforeResolveReferences"
>
+ Targets="GetLiveRefAssemblies">
-
+
false
@@ -255,10 +251,6 @@
$(BaseOutputPath)\packages\Common\test_dependencies\test_dependencies\project.assets.json
-
-
-
-
true
diff --git a/src/tests/Interop/COM/Activator/Activator.csproj b/src/tests/Interop/COM/Activator/Activator.csproj
index 87b0633ad30052..e56e4e8ae00459 100644
--- a/src/tests/Interop/COM/Activator/Activator.csproj
+++ b/src/tests/Interop/COM/Activator/Activator.csproj
@@ -1,8 +1,6 @@
Exe
-
- true
true
true
diff --git a/src/tests/Interop/COM/Activator/ActivatorBuiltInComDisabled.csproj b/src/tests/Interop/COM/Activator/ActivatorBuiltInComDisabled.csproj
index b119bcc691df99..aded9f0182369d 100644
--- a/src/tests/Interop/COM/Activator/ActivatorBuiltInComDisabled.csproj
+++ b/src/tests/Interop/COM/Activator/ActivatorBuiltInComDisabled.csproj
@@ -1,8 +1,6 @@
Exe
-
- true
true
true
diff --git a/src/tests/Interop/COM/Activator/Program.cs b/src/tests/Interop/COM/Activator/Program.cs
index b16802db9c93bd..f77c34befefc82 100644
--- a/src/tests/Interop/COM/Activator/Program.cs
+++ b/src/tests/Interop/COM/Activator/Program.cs
@@ -12,7 +12,19 @@ namespace Activator
using TestLibrary;
using Xunit;
- using Console = Internal.Console;
+ [ComImport]
+ [ComVisible(false)]
+ [Guid("00000001-0000-0000-C000-000000000046")]
+ [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
+ interface IClassFactory
+ {
+ void CreateInstance(
+ [MarshalAs(UnmanagedType.Interface)] object pUnkOuter,
+ ref Guid riid,
+ out IntPtr ppvObject);
+
+ void LockServer([MarshalAs(UnmanagedType.Bool)] bool fLock);
+ }
class Program
{
diff --git a/src/tests/Interop/Directory.Build.targets b/src/tests/Interop/Directory.Build.targets
index 0d5ce0b5580ea6..6e5570ee006b49 100644
--- a/src/tests/Interop/Directory.Build.targets
+++ b/src/tests/Interop/Directory.Build.targets
@@ -3,20 +3,11 @@
-
+
-
-
-
-
-
-
-
diff --git a/src/tests/Interop/ICastable/Castable.cs b/src/tests/Interop/ICastable/Castable.cs
index 3a20177a36e5ec..5493d164189992 100644
--- a/src/tests/Interop/ICastable/Castable.cs
+++ b/src/tests/Interop/ICastable/Castable.cs
@@ -6,18 +6,6 @@
using System.Runtime.CompilerServices;
using Xunit;
-using Console = Internal.Console;
-
-namespace Xunit
-{
- // Include an inline definition of the SkipOnMonoAttribute type as tests that reference CoreLib
- // only reference CoreLib and don't reference any other assemblies.
- public class SkipOnMonoAttribute : Attribute
- {
- public SkipOnMonoAttribute(string reason, int testPlatforms = ~0) { }
- }
-}
-
public interface IRetArg
{
T ReturnArg(T t);
diff --git a/src/tests/Interop/ICastable/Castable.csproj b/src/tests/Interop/ICastable/Castable.csproj
index 7007b694eb2133..c7323355465487 100644
--- a/src/tests/Interop/ICastable/Castable.csproj
+++ b/src/tests/Interop/ICastable/Castable.csproj
@@ -1,7 +1,6 @@
-
- true
+ true
diff --git a/src/tests/Interop/IJW/LoadIjwFromModuleHandle/LoadIjwFromModuleHandle.cs b/src/tests/Interop/IJW/LoadIjwFromModuleHandle/LoadIjwFromModuleHandle.cs
index e7df50ed4fa8bb..cfedcfd286ed23 100644
--- a/src/tests/Interop/IJW/LoadIjwFromModuleHandle/LoadIjwFromModuleHandle.cs
+++ b/src/tests/Interop/IJW/LoadIjwFromModuleHandle/LoadIjwFromModuleHandle.cs
@@ -9,8 +9,6 @@
using TestLibrary;
using Xunit;
-using Console = Internal.Console;
-
namespace LoadIjwFromModuleHandle
{
class LoadIjwFromModuleHandle
diff --git a/src/tests/Interop/IJW/LoadIjwFromModuleHandle/LoadIjwFromModuleHandle.csproj b/src/tests/Interop/IJW/LoadIjwFromModuleHandle/LoadIjwFromModuleHandle.csproj
index a42c985e422b89..d8bb911096e6d6 100644
--- a/src/tests/Interop/IJW/LoadIjwFromModuleHandle/LoadIjwFromModuleHandle.csproj
+++ b/src/tests/Interop/IJW/LoadIjwFromModuleHandle/LoadIjwFromModuleHandle.csproj
@@ -1,8 +1,6 @@
Exe
-
- true
true
true