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();