Add net451 back so windows works and Unix skips net451

This commit is contained in:
BrennanConroy 2016-06-22 15:20:09 -07:00
parent 5af281a6dd
commit 9263d63d2c
3 changed files with 24 additions and 2 deletions

View File

@ -1,8 +1,10 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.IO;
using Microsoft.AspNetCore.Server.Testing;
using Microsoft.Extensions.PlatformAbstractions;
namespace ServerComparison.FunctionalTests
{
@ -10,8 +12,23 @@ namespace ServerComparison.FunctionalTests
{
public static string GetApplicationPath(ApplicationType applicationType)
{
return Path.GetFullPath(Path.Combine("..",
applicationType == ApplicationType.Standalone? "ServerComparison.TestSites.Standalone" : "ServerComparison.TestSites"));
var applicationBasePath = PlatformServices.Default.Application.ApplicationBasePath;
var directoryInfo = new DirectoryInfo(applicationBasePath);
do
{
var solutionFileInfo = new FileInfo(Path.Combine(directoryInfo.FullName, "ServerTests.sln"));
if (solutionFileInfo.Exists)
{
var projectName = applicationType == ApplicationType.Standalone ? "ServerComparison.TestSites.Standalone" : "ServerComparison.TestSites";
return Path.GetFullPath(Path.Combine(directoryInfo.FullName, "test", projectName));
}
directoryInfo = directoryInfo.Parent;
}
while (directoryInfo.Parent != null);
throw new Exception($"Solution root could not be found using {applicationBasePath}");
}
public static string GetConfigContent(ServerType serverType, string iisConfig, string nginxConfig)

View File

@ -1,5 +1,6 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
#if NET451
using System;
using System.Net;
@ -132,3 +133,5 @@ namespace ServerComparison.FunctionalTests
}
}
}
#endif

View File

@ -15,6 +15,7 @@
"Microsoft.AspNetCore.Server.Testing": "0.2.0-*",
"Microsoft.Extensions.Logging": "1.1.0-*",
"Microsoft.Extensions.Logging.Console": "1.1.0-*",
"Microsoft.Extensions.PlatformAbstractions": "1.0.0-*",
"Microsoft.Net.Http.Headers": "1.1.0-*"
},
"publishOptions": {
@ -25,6 +26,7 @@
]
},
"frameworks": {
"net451": { },
"netcoreapp1.0": {
"dependencies": {
"Microsoft.NETCore.App": {