Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

[Wip] Add API and Tests for Collectible Assemblies and AssemblyLoadContext #14763

Closed
wants to merge 9 commits into from
Closed
2 changes: 1 addition & 1 deletion pkg/Microsoft.Private.PackageBaseline/packageIndex.json
Original file line number Diff line number Diff line change
Expand Up @@ -2242,7 +2242,7 @@
"AssemblyVersionInPackageVersion": {
"4.0.0.0": "4.0.0",
"4.0.1.0": "4.3.0",
"4.0.2.0": "4.4.0"
"4.1.0.0": "4.4.0"
}
},
"System.Runtime.Numerics": {
Expand Down
10 changes: 7 additions & 3 deletions src/System.Runtime.Loader/System.Runtime.Loader.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.23107.0
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Runtime.Loader.Tests", "tests\System.Runtime.Loader.Tests.csproj", "{701CB3BC-00DC-435D-BDE4-C5FC29A708A7}"
EndProject
Expand All @@ -11,6 +11,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Runtime.Loader.Defau
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Runtime.Loader.RefEmitLoadContext.Tests", "tests\RefEmitLoadContext\System.Runtime.Loader.RefEmitLoadContext.Tests.csproj", "{701CB3BC-00DC-435D-BDE4-C5FC29A708A9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Runtime.Loader.Test.Assembly2", "tests\System.Runtime.Loader.Test.Assembly2\System.Runtime.Loader.Test.Assembly2.csproj", "{FBF73A8E-7889-4C7D-AFC3-509B821D0FC6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -20,10 +22,12 @@ Global
{701CB3BC-00DC-435D-BDE4-C5FC29A708A7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{396D6EBF-60BD-4DAF-8783-FB403E070A56}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{396D6EBF-60BD-4DAF-8783-FB403E070A56}.Debug|Any CPU.Build.0 = Debug|Any CPU
{396D6EBF-60BD-4DAF-8783-FB403E070A57}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{396D6EBF-60BD-4DAF-8783-FB403E070A57}.Debug|Any CPU.Build.0 = Debug|Any CPU
{701CB3BC-00DC-435D-BDE4-C5FC29A708A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{701CB3BC-00DC-435D-BDE4-C5FC29A708A8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{701CB3BC-00DC-435D-BDE4-C5FC29A708A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{701CB3BC-00DC-435D-BDE4-C5FC29A708A9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FBF73A8E-7889-4C7D-AFC3-509B821D0FC6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FBF73A8E-7889-4C7D-AFC3-509B821D0FC6}.Debug|Any CPU.Build.0 = Debug|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
2 changes: 1 addition & 1 deletion src/System.Runtime.Loader/dir.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\dir.props" />
<PropertyGroup>
<AssemblyVersion>4.0.2.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<ItemGroup>
<ProjectReference Include="..\ref\System.Runtime.Loader.csproj">
<SupportedFramework>netcoreapp1.0</SupportedFramework>
<SupportedFramework>netcoreapp1.1</SupportedFramework>
</ProjectReference>
<ProjectReference Include="..\src\System.Runtime.Loader.builds"/>

Expand Down
3 changes: 3 additions & 0 deletions src/System.Runtime.Loader/ref/System.Runtime.Loader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,13 @@ namespace System.Runtime.Loader
public abstract partial class AssemblyLoadContext
{
protected AssemblyLoadContext() { }
protected AssemblyLoadContext(bool isCollectible) { }
public static System.Runtime.Loader.AssemblyLoadContext Default { get { throw null; } }
public static System.Reflection.AssemblyName GetAssemblyName(string assemblyPath) { throw null; }
public static System.Runtime.Loader.AssemblyLoadContext GetLoadContext(System.Reflection.Assembly assembly) { throw null; }
public bool IsCollectible { get { throw null; } }
protected abstract System.Reflection.Assembly Load(System.Reflection.AssemblyName assemblyName);
public void Unload(){ throw null; }
public System.Reflection.Assembly LoadFromAssemblyName(System.Reflection.AssemblyName assemblyName) { throw null; }
public System.Reflection.Assembly LoadFromAssemblyPath(string assemblyPath) { throw null; }
public System.Reflection.Assembly LoadFromNativeImagePath(string nativeImagePath, string assemblyPath) { throw null; }
Expand Down
2 changes: 1 addition & 1 deletion src/System.Runtime.Loader/ref/System.Runtime.Loader.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<PropertyGroup>
<OutputType>Library</OutputType>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<NuGetTargetMoniker>.NETStandard,Version=v1.5</NuGetTargetMoniker>
<NuGetTargetMoniker>.NETStandard,Version=v1.7</NuGetTargetMoniker>
</PropertyGroup>
<ItemGroup>
<Compile Include="System.Runtime.Loader.cs" />
Expand Down
10 changes: 5 additions & 5 deletions src/System.Runtime.Loader/ref/project.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"dependencies": {
"System.Runtime": "4.3.0",
"System.Reflection": "4.3.0",
"System.Reflection.Primitives": "4.3.0",
"System.IO": "4.3.0"
"System.Runtime": "4.4.0-beta-24827-01",
"System.Reflection": "4.4.0-beta-24827-01",
"System.Reflection.Primitives": "4.4.0-beta-24827-01",
"System.IO": "4.4.0-beta-24827-01"
},
"frameworks": {
"netstandard1.5": {}
"netstandard1.7": {}
}
}
2 changes: 1 addition & 1 deletion src/System.Runtime.Loader/src/System.Runtime.Loader.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<PropertyGroup>
<AssemblyName>System.Runtime.Loader</AssemblyName>
<IsPartialFacadeAssembly>true</IsPartialFacadeAssembly>
<NuGetTargetMoniker Condition="'$(TargetGroup)' == ''">.NETStandard,Version=v1.5</NuGetTargetMoniker>
<NuGetTargetMoniker Condition="'$(TargetGroup)' == ''">.NETStandard,Version=v1.7</NuGetTargetMoniker>
</PropertyGroup>
<!-- Help VS understand available configurations -->
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'" />
Expand Down
2 changes: 1 addition & 1 deletion src/System.Runtime.Loader/src/project.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"frameworks": {
"netstandard1.5": {
"netstandard1.7": {
"dependencies": {
"Microsoft.TargetingPack.Private.CoreCLR": "1.2.0-beta-24828-03"
}
Expand Down
3 changes: 2 additions & 1 deletion src/System.Runtime.Loader/tests/AssemblyLoadContextTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@

namespace System.Runtime.Loader.Tests
{
public class AssemblyLoadContextTest
public partial class AssemblyLoadContextTest
{
private const string TestAssembly = "System.Runtime.Loader.Test.Assembly";
private const string TestAssembly2 = "System.Runtime.Loader.Test.Assembly2";

[Fact]
public static void GetAssemblyNameTest_ValidAssembly()
Expand Down
Loading