dotnet-installer/src/Microsoft.Extensions.DependencyModel/RuntimeAssembly.cs

28 lines
795 B
C#
Raw Normal View History

// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System.IO;
using System.Reflection;
namespace Microsoft.Extensions.DependencyModel
{
public class RuntimeAssembly
{
private readonly string _assemblyName;
public RuntimeAssembly(string assemblyName, string path)
{
_assemblyName = assemblyName;
Path = path;
}
public AssemblyName Name => new AssemblyName(_assemblyName);
public string Path { get; }
2016-03-02 15:31:13 -08:00
public static RuntimeAssembly Create(string path)
{
return new RuntimeAssembly(System.IO.Path.GetFileNameWithoutExtension(path), path);
}
}
}