diff --git a/test/E2ETests/DeploymentUtility.cs b/test/E2ETests/DeploymentUtility.cs index b9b398e305..beb2d2df3f 100644 --- a/test/E2ETests/DeploymentUtility.cs +++ b/test/E2ETests/DeploymentUtility.cs @@ -3,6 +3,8 @@ using System.Diagnostics; using System.IO; using System.Linq; using System.Threading; +using Microsoft.Framework.Runtime; +using Microsoft.Framework.Runtime.Infrastructure; namespace E2ETests { @@ -32,9 +34,12 @@ namespace E2ETests /// private static void CopyAspNetLoader(string applicationPath) { - string packagesDirectory = Path.GetFullPath(Path.Combine(Environment.CurrentDirectory, @"..\..\Packages")); - var aspNetLoaderSrcPath = Path.Combine(Directory.GetDirectories(packagesDirectory, "Microsoft.AspNet.Loader.IIS.Interop.*").First(), @"tools\AspNet.Loader.dll"); - var aspNetLoaderDestPath = Path.Combine(applicationPath, @"bin\AspNet.Loader.dll"); + var libraryManager = (ILibraryManager)CallContextServiceLocator.Locator.ServiceProvider.GetService(typeof(ILibraryManager)); + var interopLibrary = libraryManager.GetLibraryInformation("Microsoft.AspNet.Loader.IIS.Interop"); + + var aspNetLoaderSrcPath = Path.Combine(interopLibrary.Path, "tools", "AspNet.Loader.dll"); + var aspNetLoaderDestPath = Path.Combine(applicationPath, "bin", "AspNet.Loader.dll"); + if (!File.Exists(aspNetLoaderDestPath)) { File.Copy(aspNetLoaderSrcPath, aspNetLoaderDestPath); @@ -112,8 +117,8 @@ namespace E2ETests Console.WriteLine(); Console.WriteLine("Current %PATH% value : {0}", pathValue); - pathValue = (kreFlavor == KreFlavor.CoreClr) ? - pathValue.Replace("KRE-svr50-", "KRE-svrc50-") : + pathValue = (kreFlavor == KreFlavor.CoreClr) ? + pathValue.Replace("KRE-svr50-", "KRE-svrc50-") : pathValue.Replace("KRE-svrc50-", "KRE-svr50-"); Console.WriteLine(); diff --git a/test/E2ETests/project.json b/test/E2ETests/project.json index a570f62a18..25b4a35697 100644 --- a/test/E2ETests/project.json +++ b/test/E2ETests/project.json @@ -3,6 +3,8 @@ "test": "Xunit.KRunner" }, "dependencies": { + "Microsoft.AspNet.Server.IIS": "1.0.0-*", + "Microsoft.Framework.Runtime.Interfaces": "1.0.0-*", "Xunit.KRunner": "1.0.0-*" }, "configurations": {