From b7bdc9c40494f8e0f0eac22db91b8d5c58811ee2 Mon Sep 17 00:00:00 2001 From: = Date: Mon, 21 Mar 2016 10:56:39 -0700 Subject: [PATCH] Fix relative content root path test for non-windows systems --- .../WebHostBuilderTests.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/Microsoft.AspNetCore.Hosting.Tests/WebHostBuilderTests.cs b/test/Microsoft.AspNetCore.Hosting.Tests/WebHostBuilderTests.cs index c3ac1b6794..026fcf9851 100644 --- a/test/Microsoft.AspNetCore.Hosting.Tests/WebHostBuilderTests.cs +++ b/test/Microsoft.AspNetCore.Hosting.Tests/WebHostBuilderTests.cs @@ -333,8 +333,15 @@ namespace Microsoft.AspNetCore.Hosting [Fact] public void RelativeContentRootIsResolved() { + var contentRootNet451 = PlatformServices.Default.Runtime.OperatingSystemPlatform == Platform.Windows ? + "testroot" : "../../../../test/Microsoft.AspNetCore.Hosting.Tests/testroot"; + var host = new WebHostBuilder() +#if NET451 + .UseContentRoot(contentRootNet451) +#else .UseContentRoot("testroot") +#endif .UseServer(new TestServer()) .UseStartup("Microsoft.AspNetCore.Hosting.Tests") .Build();