Use runtime APIs to locate AspNet.Loader.dll
This commit is contained in:
parent
db429b0d59
commit
ff9e21b647
|
|
@ -3,6 +3,8 @@ using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
using Microsoft.Framework.Runtime;
|
||||||
|
using Microsoft.Framework.Runtime.Infrastructure;
|
||||||
|
|
||||||
namespace E2ETests
|
namespace E2ETests
|
||||||
{
|
{
|
||||||
|
|
@ -32,9 +34,12 @@ namespace E2ETests
|
||||||
/// <param name="applicationPath"></param>
|
/// <param name="applicationPath"></param>
|
||||||
private static void CopyAspNetLoader(string applicationPath)
|
private static void CopyAspNetLoader(string applicationPath)
|
||||||
{
|
{
|
||||||
string packagesDirectory = Path.GetFullPath(Path.Combine(Environment.CurrentDirectory, @"..\..\Packages"));
|
var libraryManager = (ILibraryManager)CallContextServiceLocator.Locator.ServiceProvider.GetService(typeof(ILibraryManager));
|
||||||
var aspNetLoaderSrcPath = Path.Combine(Directory.GetDirectories(packagesDirectory, "Microsoft.AspNet.Loader.IIS.Interop.*").First(), @"tools\AspNet.Loader.dll");
|
var interopLibrary = libraryManager.GetLibraryInformation("Microsoft.AspNet.Loader.IIS.Interop");
|
||||||
var aspNetLoaderDestPath = Path.Combine(applicationPath, @"bin\AspNet.Loader.dll");
|
|
||||||
|
var aspNetLoaderSrcPath = Path.Combine(interopLibrary.Path, "tools", "AspNet.Loader.dll");
|
||||||
|
var aspNetLoaderDestPath = Path.Combine(applicationPath, "bin", "AspNet.Loader.dll");
|
||||||
|
|
||||||
if (!File.Exists(aspNetLoaderDestPath))
|
if (!File.Exists(aspNetLoaderDestPath))
|
||||||
{
|
{
|
||||||
File.Copy(aspNetLoaderSrcPath, aspNetLoaderDestPath);
|
File.Copy(aspNetLoaderSrcPath, aspNetLoaderDestPath);
|
||||||
|
|
@ -112,8 +117,8 @@ namespace E2ETests
|
||||||
Console.WriteLine();
|
Console.WriteLine();
|
||||||
Console.WriteLine("Current %PATH% value : {0}", pathValue);
|
Console.WriteLine("Current %PATH% value : {0}", pathValue);
|
||||||
|
|
||||||
pathValue = (kreFlavor == KreFlavor.CoreClr) ?
|
pathValue = (kreFlavor == KreFlavor.CoreClr) ?
|
||||||
pathValue.Replace("KRE-svr50-", "KRE-svrc50-") :
|
pathValue.Replace("KRE-svr50-", "KRE-svrc50-") :
|
||||||
pathValue.Replace("KRE-svrc50-", "KRE-svr50-");
|
pathValue.Replace("KRE-svrc50-", "KRE-svr50-");
|
||||||
|
|
||||||
Console.WriteLine();
|
Console.WriteLine();
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@
|
||||||
"test": "Xunit.KRunner"
|
"test": "Xunit.KRunner"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"Microsoft.AspNet.Server.IIS": "1.0.0-*",
|
||||||
|
"Microsoft.Framework.Runtime.Interfaces": "1.0.0-*",
|
||||||
"Xunit.KRunner": "1.0.0-*"
|
"Xunit.KRunner": "1.0.0-*"
|
||||||
},
|
},
|
||||||
"configurations": {
|
"configurations": {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue