add ProjectAssemblyLoadContext

allows the loading of assemblies in the context of an existing project
This commit is contained in:
Andrew Stanton-Nurse 2015-12-08 11:30:25 -08:00
parent fa52d02b9a
commit 4e6244d8a8
15 changed files with 347 additions and 50 deletions

View file

@ -47,6 +47,16 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Extensions.Testin
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.DotNet.Tools.Test", "src\Microsoft.DotNet.Tools.Test\Microsoft.DotNet.Tools.Test.xproj", "{F003F228-2AE2-4E9D-877B-93EB773B5061}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.DotNet.ProjectModel.Loader", "src\Microsoft.DotNet.ProjectModel.Loader\Microsoft.DotNet.ProjectModel.Loader.xproj", "{C7AF0290-EF0D-44DC-9EDC-600803B664F8}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{17735A9D-BFD9-4585-A7CB-3208CA6EA8A7}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "TestApp", "test\TestApp\TestApp.xproj", "{58808BBC-371E-47D6-A3D0-4902145EDA4E}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "TestLibrary", "test\TestLibrary\TestLibrary.xproj", "{947DD232-8D9B-4B78-9C6A-94F807D2DD58}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "LoadContextTest", "test\LoadContextTest\LoadContextTest.xproj", "{7A75ACC4-3C2F-44E1-B492-0EC08704E9FF}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -347,6 +357,70 @@ Global
{F003F228-2AE2-4E9D-877B-93EB773B5061}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU
{F003F228-2AE2-4E9D-877B-93EB773B5061}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU
{F003F228-2AE2-4E9D-877B-93EB773B5061}.RelWithDebInfo|x64.Build.0 = Release|Any CPU
{C7AF0290-EF0D-44DC-9EDC-600803B664F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C7AF0290-EF0D-44DC-9EDC-600803B664F8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C7AF0290-EF0D-44DC-9EDC-600803B664F8}.Debug|x64.ActiveCfg = Debug|Any CPU
{C7AF0290-EF0D-44DC-9EDC-600803B664F8}.Debug|x64.Build.0 = Debug|Any CPU
{C7AF0290-EF0D-44DC-9EDC-600803B664F8}.MinSizeRel|Any CPU.ActiveCfg = Debug|Any CPU
{C7AF0290-EF0D-44DC-9EDC-600803B664F8}.MinSizeRel|Any CPU.Build.0 = Debug|Any CPU
{C7AF0290-EF0D-44DC-9EDC-600803B664F8}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU
{C7AF0290-EF0D-44DC-9EDC-600803B664F8}.MinSizeRel|x64.Build.0 = Debug|Any CPU
{C7AF0290-EF0D-44DC-9EDC-600803B664F8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C7AF0290-EF0D-44DC-9EDC-600803B664F8}.Release|Any CPU.Build.0 = Release|Any CPU
{C7AF0290-EF0D-44DC-9EDC-600803B664F8}.Release|x64.ActiveCfg = Release|Any CPU
{C7AF0290-EF0D-44DC-9EDC-600803B664F8}.Release|x64.Build.0 = Release|Any CPU
{C7AF0290-EF0D-44DC-9EDC-600803B664F8}.RelWithDebInfo|Any CPU.ActiveCfg = Release|Any CPU
{C7AF0290-EF0D-44DC-9EDC-600803B664F8}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU
{C7AF0290-EF0D-44DC-9EDC-600803B664F8}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU
{C7AF0290-EF0D-44DC-9EDC-600803B664F8}.RelWithDebInfo|x64.Build.0 = Release|Any CPU
{58808BBC-371E-47D6-A3D0-4902145EDA4E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{58808BBC-371E-47D6-A3D0-4902145EDA4E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{58808BBC-371E-47D6-A3D0-4902145EDA4E}.Debug|x64.ActiveCfg = Debug|Any CPU
{58808BBC-371E-47D6-A3D0-4902145EDA4E}.Debug|x64.Build.0 = Debug|Any CPU
{58808BBC-371E-47D6-A3D0-4902145EDA4E}.MinSizeRel|Any CPU.ActiveCfg = Debug|Any CPU
{58808BBC-371E-47D6-A3D0-4902145EDA4E}.MinSizeRel|Any CPU.Build.0 = Debug|Any CPU
{58808BBC-371E-47D6-A3D0-4902145EDA4E}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU
{58808BBC-371E-47D6-A3D0-4902145EDA4E}.MinSizeRel|x64.Build.0 = Debug|Any CPU
{58808BBC-371E-47D6-A3D0-4902145EDA4E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{58808BBC-371E-47D6-A3D0-4902145EDA4E}.Release|Any CPU.Build.0 = Release|Any CPU
{58808BBC-371E-47D6-A3D0-4902145EDA4E}.Release|x64.ActiveCfg = Release|Any CPU
{58808BBC-371E-47D6-A3D0-4902145EDA4E}.Release|x64.Build.0 = Release|Any CPU
{58808BBC-371E-47D6-A3D0-4902145EDA4E}.RelWithDebInfo|Any CPU.ActiveCfg = Release|Any CPU
{58808BBC-371E-47D6-A3D0-4902145EDA4E}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU
{58808BBC-371E-47D6-A3D0-4902145EDA4E}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU
{58808BBC-371E-47D6-A3D0-4902145EDA4E}.RelWithDebInfo|x64.Build.0 = Release|Any CPU
{947DD232-8D9B-4B78-9C6A-94F807D2DD58}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{947DD232-8D9B-4B78-9C6A-94F807D2DD58}.Debug|Any CPU.Build.0 = Debug|Any CPU
{947DD232-8D9B-4B78-9C6A-94F807D2DD58}.Debug|x64.ActiveCfg = Debug|Any CPU
{947DD232-8D9B-4B78-9C6A-94F807D2DD58}.Debug|x64.Build.0 = Debug|Any CPU
{947DD232-8D9B-4B78-9C6A-94F807D2DD58}.MinSizeRel|Any CPU.ActiveCfg = Debug|Any CPU
{947DD232-8D9B-4B78-9C6A-94F807D2DD58}.MinSizeRel|Any CPU.Build.0 = Debug|Any CPU
{947DD232-8D9B-4B78-9C6A-94F807D2DD58}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU
{947DD232-8D9B-4B78-9C6A-94F807D2DD58}.MinSizeRel|x64.Build.0 = Debug|Any CPU
{947DD232-8D9B-4B78-9C6A-94F807D2DD58}.Release|Any CPU.ActiveCfg = Release|Any CPU
{947DD232-8D9B-4B78-9C6A-94F807D2DD58}.Release|Any CPU.Build.0 = Release|Any CPU
{947DD232-8D9B-4B78-9C6A-94F807D2DD58}.Release|x64.ActiveCfg = Release|Any CPU
{947DD232-8D9B-4B78-9C6A-94F807D2DD58}.Release|x64.Build.0 = Release|Any CPU
{947DD232-8D9B-4B78-9C6A-94F807D2DD58}.RelWithDebInfo|Any CPU.ActiveCfg = Release|Any CPU
{947DD232-8D9B-4B78-9C6A-94F807D2DD58}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU
{947DD232-8D9B-4B78-9C6A-94F807D2DD58}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU
{947DD232-8D9B-4B78-9C6A-94F807D2DD58}.RelWithDebInfo|x64.Build.0 = Release|Any CPU
{7A75ACC4-3C2F-44E1-B492-0EC08704E9FF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7A75ACC4-3C2F-44E1-B492-0EC08704E9FF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7A75ACC4-3C2F-44E1-B492-0EC08704E9FF}.Debug|x64.ActiveCfg = Debug|Any CPU
{7A75ACC4-3C2F-44E1-B492-0EC08704E9FF}.Debug|x64.Build.0 = Debug|Any CPU
{7A75ACC4-3C2F-44E1-B492-0EC08704E9FF}.MinSizeRel|Any CPU.ActiveCfg = Debug|Any CPU
{7A75ACC4-3C2F-44E1-B492-0EC08704E9FF}.MinSizeRel|Any CPU.Build.0 = Debug|Any CPU
{7A75ACC4-3C2F-44E1-B492-0EC08704E9FF}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU
{7A75ACC4-3C2F-44E1-B492-0EC08704E9FF}.MinSizeRel|x64.Build.0 = Debug|Any CPU
{7A75ACC4-3C2F-44E1-B492-0EC08704E9FF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7A75ACC4-3C2F-44E1-B492-0EC08704E9FF}.Release|Any CPU.Build.0 = Release|Any CPU
{7A75ACC4-3C2F-44E1-B492-0EC08704E9FF}.Release|x64.ActiveCfg = Release|Any CPU
{7A75ACC4-3C2F-44E1-B492-0EC08704E9FF}.Release|x64.Build.0 = Release|Any CPU
{7A75ACC4-3C2F-44E1-B492-0EC08704E9FF}.RelWithDebInfo|Any CPU.ActiveCfg = Release|Any CPU
{7A75ACC4-3C2F-44E1-B492-0EC08704E9FF}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU
{7A75ACC4-3C2F-44E1-B492-0EC08704E9FF}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU
{7A75ACC4-3C2F-44E1-B492-0EC08704E9FF}.RelWithDebInfo|x64.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -370,5 +444,9 @@ Global
{DB29F219-DC92-4AF7-A2EE-E89FFBB3F5F0} = {ED2FE3E2-F7E7-4389-8231-B65123F2076F}
{DCDFE282-03DE-4DBC-B90C-CC3CE3EC8162} = {ED2FE3E2-F7E7-4389-8231-B65123F2076F}
{F003F228-2AE2-4E9D-877B-93EB773B5061} = {ED2FE3E2-F7E7-4389-8231-B65123F2076F}
{C7AF0290-EF0D-44DC-9EDC-600803B664F8} = {ED2FE3E2-F7E7-4389-8231-B65123F2076F}
{58808BBC-371E-47D6-A3D0-4902145EDA4E} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7}
{947DD232-8D9B-4B78-9C6A-94F807D2DD58} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7}
{7A75ACC4-3C2F-44E1-B492-0EC08704E9FF} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7}
EndGlobalSection
EndGlobal

View file

@ -1,14 +1,14 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Runtime.Loader;
using Microsoft.Extensions.ProjectModel;
namespace Microsoft.DotNet.ProjectModel.Loader
{
public static class LoaderProjectContextExtensions
{
public static AssemblyLoadContext Create(this ProjectContext context, string configuration = "Debug")
public static AssemblyLoadContext CreateLoadContext(this ProjectContext context, string configuration = "Debug")
{
var exporter = context.CreateExporter(configuration);
var assemblies = new Dictionary<AssemblyName, string>();
@ -32,7 +32,10 @@ namespace Microsoft.DotNet.ProjectModel.Loader
}
}
return new ProjectContextLoadContext(assemblies, dllImports);
return new ProjectLoadContext(
assemblies,
dllImports,
new[] { context.GetOutputDirectoryPath(configuration) });
}
}
}

View file

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0.24720" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0.24720</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>c7af0290-ef0d-44dc-9edc-600803b664f8</ProjectGuid>
<RootNamespace>Microsoft.DotNet.ProjectModel.Loader</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\bin\$(MSBuildProjectName)\</OutputPath>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>

View file

@ -1,41 +0,0 @@
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.Loader;
namespace Microsoft.DotNet.ProjectModel.Loader
{
public class ProjectContextLoadContext : AssemblyLoadContext
{
private readonly Dictionary<AssemblyName, string> _assemblies;
private readonly Dictionary<string, string> _dllImports;
public ProjectContextLoadContext(Dictionary<AssemblyName, string> assemblies,
Dictionary<string, string> dllImports)
{
_assemblies = assemblies;
_dllImports = dllImports;
}
protected override Assembly Load(AssemblyName assemblyName)
{
string path;
if (_assemblies.TryGetValue(assemblyName, out path))
{
return LoadFromAssemblyPath(path);
}
return null;
}
protected override IntPtr LoadUnmanagedDll(string unmanagedDllName)
{
string path;
if (_dllImports.TryGetValue(unmanagedDllName, out path))
{
return LoadUnmanagedDllFromPath(path);
}
return base.LoadUnmanagedDll(unmanagedDllName);
}
}
}

View file

@ -0,0 +1,95 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Runtime.Loader;
namespace Microsoft.DotNet.ProjectModel.Loader
{
/// <summary>
/// An <see cref="AssemblyLoadContext"/> designed to allow loading from a Project.
/// </summary>
public class ProjectLoadContext : AssemblyLoadContext
{
private readonly IDictionary<AssemblyName, string> _assemblyPaths;
private readonly IDictionary<string, string> _nativeLibraries;
private readonly IEnumerable<string> _searchPaths;
private static readonly string[] NativeLibraryExtensions;
private static readonly string[] ManagedAssemblyExtensions = new[]
{
".dll",
".ni.dll",
".exe",
".ni.exe"
};
static ProjectLoadContext()
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
NativeLibraryExtensions = new[] { ".dll" };
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
NativeLibraryExtensions = new[] { ".dylib" };
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
NativeLibraryExtensions = new[] { ".so" };
}
NativeLibraryExtensions = new string[0];
}
public ProjectLoadContext(IDictionary<AssemblyName, string> assemblyPaths,
IDictionary<string, string> nativeLibraries,
IEnumerable<string> searchPaths)
{
_assemblyPaths = assemblyPaths;
_nativeLibraries = nativeLibraries;
_searchPaths = searchPaths;
}
protected override Assembly Load(AssemblyName assemblyName)
{
string path;
if (_assemblyPaths.TryGetValue(assemblyName, out path) || SearchForLibrary(ManagedAssemblyExtensions, assemblyName.Name, out path))
{
return LoadFromAssemblyPath(path);
}
return null;
}
protected override IntPtr LoadUnmanagedDll(string unmanagedDllName)
{
string path;
if (_nativeLibraries.TryGetValue(unmanagedDllName, out path) || SearchForLibrary(NativeLibraryExtensions, unmanagedDllName, out path))
{
return LoadUnmanagedDllFromPath(path);
}
return base.LoadUnmanagedDll(unmanagedDllName);
}
private bool SearchForLibrary(string[] extensions, string name, out string path)
{
foreach(var searchPath in _searchPaths)
{
foreach(var extension in extensions)
{
var candidate = Path.Combine(searchPath, name + extension);
if(File.Exists(candidate))
{
path = candidate;
return true;
}
}
}
path = null;
return false;
}
}
}

View file

@ -1,6 +1,7 @@
{
"dependencies": {
"Microsoft.DotNet.ProjectModel": "1.0.0-*",
"System.AppContext": "4.0.1-beta-23504",
"System.Runtime.Loader": "4.0.0-beta-23504"
},
"frameworks": {

View file

@ -1,5 +1,4 @@
using Microsoft.CodeAnalysis;
using Microsoft.Extensions.ProjectModel;
namespace Microsoft.DotNet.ProjectModel.Workspaces
{

View file

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Microsoft.DotNet.ProjectModel
{
internal static class Constants
{
public static readonly string DefaultOutputDirectory = "bin";
public static readonly string DefaultConfiguration = "Debug";
}
}

View file

@ -113,14 +113,18 @@ namespace Microsoft.DotNet.ProjectModel
ProjectFile.Name + FileNameSuffixes.DotNet.ProgramDatabase);
}
private string GetOutputDirectoryPath(string buildConfiguration)
public string GetOutputDirectoryPath(string buildConfiguration)
{
return Path.Combine(
var outDir = Path.Combine(
ProjectDirectory,
DirectoryNames.Bin,
buildConfiguration,
TargetFramework.GetShortFolderName(),
ProjectModel.RuntimeIdentifier.Current);
TargetFramework.GetShortFolderName());
if (!string.IsNullOrEmpty(RuntimeIdentifier))
{
outDir = Path.Combine(outDir, RuntimeIdentifier);
}
return outDir;
}
}
}

View file

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>7a75acc4-3c2f-44e1-b492-0ec08704e9ff</ProjectGuid>
<RootNamespace>LoadContextTest</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\bin\$(MSBuildProjectName)\</OutputPath>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>

View file

@ -0,0 +1,51 @@
using System;
using System.IO;
using System.Reflection;
using Microsoft.DotNet.ProjectModel;
using Microsoft.DotNet.ProjectModel.Loader;
using NuGet.Frameworks;
namespace LoadContextTest
{
public class Program
{
public static int Main(string[] args)
{
Console.WriteLine("Press enter to start");
Console.ReadLine();
// Get the path to the project
if(args.Length < 1)
{
Console.Error.WriteLine("Usage: LoadContextTest <path to project>");
return 1;
}
var project = Path.GetFullPath(args[0]);
// Load the project load context
Console.WriteLine($"Creating load context for {project}");
var context = ProjectContext.Create(project, FrameworkConstants.CommonFrameworks.DnxCore50, new[] { RuntimeIdentifier.Current });
var loadContext = context.CreateLoadContext();
// Load the project assembly
var asm = loadContext.LoadFromAssemblyName(new AssemblyName(context.ProjectFile.Name));
// Find the helper type and method
var type = asm.GetType("TestLibrary.Helper");
if(type == null)
{
Console.Error.WriteLine("Failed to find type");
return 1;
}
var method = type.GetMethod("SayHi", BindingFlags.Public | BindingFlags.Static);
if(method == null)
{
Console.Error.WriteLine("Failed to find method");
return 1;
}
// Call it!
method.Invoke(null, new object[0]);
return 0;
}
}
}

View file

@ -0,0 +1,23 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("LoadContextTest")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("LoadContextTest")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("7a75acc4-3c2f-44e1-b492-0ec08704e9ff")]

View file

@ -0,0 +1,26 @@
{
"version": "1.0.0-*",
"description": "LoadContextTest Console Application",
"authors": [ "anurse" ],
"tags": [ "" ],
"projectUrl": "",
"licenseUrl": "",
"compilationOptions": {
"emitEntryPoint": true
},
"dependencies": {
"Microsoft.CSharp": "4.0.1-beta-23516",
"System.Collections": "4.0.11-beta-23516",
"System.Console": "4.0.0-beta-23516",
"System.Linq": "4.0.1-beta-23516",
"System.Threading": "4.0.11-beta-23516",
"Microsoft.DotNet.ProjectModel.Loader": { "target": "project" }
},
"frameworks": {
"dnxcore50": { }
}
}

View file

@ -11,5 +11,10 @@ namespace TestLibrary
{
return "This string came from the test library!";
}
public static void SayHi()
{
Console.WriteLine("Hello there!");
}
}
}

View file

@ -1,7 +1,8 @@
{
"version": "1.0.0-*",
"dependencies": {
"System.Runtime": "4.0.21-beta-23428"
"System.Runtime": "4.0.21-beta-23428",
"System.Console": "4.0.0-beta-23428"
},
"frameworks": {