Skip to content
This repository was archived by the owner on Nov 9, 2018. It is now read-only.

Commit 6216030

Browse files
committed
Minimal fix for #117
This passes the port through to the ApplicationHost to avoid a problem where the compiler has already decided to use DTH, but doesn't know the port. The more complete fix will be to eliminate the use of the ApplicationHost code inside TestHost.
1 parent d5a6fac commit 6216030

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/Microsoft.Framework.TestHost/ProjectCommand.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

44
using System;
5+
using System.Linq;
56
using System.Threading.Tasks;
67
using Microsoft.Framework.Runtime;
78
using Microsoft.Framework.Runtime.Common.DependencyInjection;
@@ -30,6 +31,17 @@ public static async Task<int> Execute(
3031
environment,
3132
newServices);
3233

34+
var options = (IRuntimeOptions)services.GetService(typeof(IRuntimeOptions));
35+
if (options.CompilationServerPort.HasValue)
36+
{
37+
args = new string[]
38+
{
39+
"--port",
40+
options.CompilationServerPort.Value.ToString()
41+
}
42+
.Concat(args).ToArray();
43+
}
44+
3345
return await applicationHost.Main(args);
3446
}
3547
}

0 commit comments

Comments
 (0)