Merge branch 'release' into dev
This commit is contained in:
commit
bc94654a75
|
|
@ -9,25 +9,16 @@
|
||||||
"compilationOptions": {
|
"compilationOptions": {
|
||||||
"emitEntryPoint": true
|
"emitEntryPoint": true
|
||||||
},
|
},
|
||||||
"commands": {
|
|
||||||
"web": "IISSample"
|
|
||||||
},
|
|
||||||
"frameworks": {
|
"frameworks": {
|
||||||
"net451": { },
|
"net451": { },
|
||||||
"netstandardapp1.5": {
|
"netstandardapp1.5": {
|
||||||
"imports": "portable-net451+win8"
|
"dependencies": {
|
||||||
|
"NETStandard.Library": "1.5.0-*"
|
||||||
|
},
|
||||||
|
"imports": "dnxcore50"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"publishExclude": [
|
"content": [
|
||||||
"node_modules",
|
"web.config"
|
||||||
"bower_components",
|
|
||||||
"**.xproj",
|
|
||||||
"**.user",
|
|
||||||
"**.vspscc"
|
|
||||||
],
|
|
||||||
"exclude": [
|
|
||||||
"wwwroot",
|
|
||||||
"node_modules",
|
|
||||||
"bower_components"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,13 +14,12 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.Tools
|
||||||
var app = new CommandLineApplication
|
var app = new CommandLineApplication
|
||||||
{
|
{
|
||||||
Name = "dotnet publish-iis",
|
Name = "dotnet publish-iis",
|
||||||
FullName = "Asp.Net IIS Publisher",
|
FullName = "Asp.Net Core IIS Publisher",
|
||||||
Description = "IIS Publisher for the Asp.Net web applications",
|
Description = "IIS Publisher for the Asp.Net Core web applications",
|
||||||
};
|
};
|
||||||
app.HelpOption("-h|--help");
|
app.HelpOption("-h|--help");
|
||||||
|
|
||||||
var publishFolderOption = app.Option("--publish-folder|-p", "The path to the publish output folder", CommandOptionType.SingleValue);
|
var publishFolderOption = app.Option("--publish-folder|-p", "The path to the publish output folder", CommandOptionType.SingleValue);
|
||||||
var webRootOption = app.Option("--webroot|-w", "The name of webroot folder", CommandOptionType.SingleValue);
|
|
||||||
var projectPath = app.Argument("<PROJECT>", "The path to the project (project folder or project.json) being published. If empty the current directory is used.");
|
var projectPath = app.Argument("<PROJECT>", "The path to the project (project folder or project.json) being published. If empty the current directory is used.");
|
||||||
|
|
||||||
app.OnExecute(() =>
|
app.OnExecute(() =>
|
||||||
|
|
@ -35,7 +34,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.Tools
|
||||||
|
|
||||||
Reporter.Output.WriteLine($"Configuring the following project for use with IIS: '{publishFolder}'");
|
Reporter.Output.WriteLine($"Configuring the following project for use with IIS: '{publishFolder}'");
|
||||||
|
|
||||||
var exitCode = new PublishIISCommand(publishFolder, projectPath.Value, webRootOption.Value()).Run();
|
var exitCode = new PublishIISCommand(publishFolder, projectPath.Value).Run();
|
||||||
|
|
||||||
Reporter.Output.WriteLine("Configuring project completed successfully");
|
Reporter.Output.WriteLine("Configuring project completed successfully");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,23 +15,19 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.Tools
|
||||||
{
|
{
|
||||||
private readonly string _publishFolder;
|
private readonly string _publishFolder;
|
||||||
private readonly string _projectPath;
|
private readonly string _projectPath;
|
||||||
private readonly string _webRoot;
|
|
||||||
|
|
||||||
public PublishIISCommand(string publishFolder, string projectPath, string webRoot)
|
public PublishIISCommand(string publishFolder, string projectPath)
|
||||||
{
|
{
|
||||||
_publishFolder = publishFolder;
|
_publishFolder = publishFolder;
|
||||||
_projectPath = projectPath;
|
_projectPath = projectPath;
|
||||||
_webRoot = webRoot;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int Run()
|
public int Run()
|
||||||
{
|
{
|
||||||
var applicationBasePath = GetApplicationBasePath();
|
var applicationBasePath = GetApplicationBasePath();
|
||||||
var webRoot = GetWebRoot(applicationBasePath);
|
|
||||||
|
|
||||||
XDocument webConfigXml = null;
|
XDocument webConfigXml = null;
|
||||||
var webRootDirectory = Path.Combine(_publishFolder, webRoot);
|
var webConfigPath = Path.Combine(_publishFolder, "web.config");
|
||||||
var webConfigPath = Path.Combine(webRootDirectory, "web.config");
|
|
||||||
if (File.Exists(webConfigPath))
|
if (File.Exists(webConfigPath))
|
||||||
{
|
{
|
||||||
Reporter.Output.WriteLine($"Updating web.config at '{webConfigPath}'");
|
Reporter.Output.WriteLine($"Updating web.config at '{webConfigPath}'");
|
||||||
|
|
@ -44,12 +40,6 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.Tools
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!Directory.Exists(webRootDirectory))
|
|
||||||
{
|
|
||||||
Reporter.Output.WriteLine($"No webroot directory found. Creating '{webRootDirectory}'");
|
|
||||||
Directory.CreateDirectory(webRootDirectory);
|
|
||||||
}
|
|
||||||
|
|
||||||
Reporter.Output.WriteLine($"No web.config found. Creating '{webConfigPath}'");
|
Reporter.Output.WriteLine($"No web.config found. Creating '{webConfigPath}'");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -83,32 +73,6 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.Tools
|
||||||
return ProjectReader.GetProject(Path.Combine(applicationBasePath, "project.json")).Name;
|
return ProjectReader.GetProject(Path.Combine(applicationBasePath, "project.json")).Name;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string GetWebRoot(string applicationBasePath)
|
|
||||||
{
|
|
||||||
if (!string.IsNullOrEmpty(_webRoot))
|
|
||||||
{
|
|
||||||
return _webRoot;
|
|
||||||
}
|
|
||||||
|
|
||||||
var builder = new ConfigurationBuilder()
|
|
||||||
.SetBasePath(applicationBasePath)
|
|
||||||
.AddJsonFile("hosting.json", optional: true);
|
|
||||||
|
|
||||||
var webroot = builder.Build()["webroot"];
|
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(webroot))
|
|
||||||
{
|
|
||||||
return webroot;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Directory.Exists(Path.Combine(applicationBasePath, "wwwroot")))
|
|
||||||
{
|
|
||||||
return "wwwroot";
|
|
||||||
}
|
|
||||||
|
|
||||||
return string.Empty;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static bool ConfigureForAzure()
|
private static bool ConfigureForAzure()
|
||||||
{
|
{
|
||||||
var configureForAzureValue = Environment.GetEnvironmentVariable("DOTNET_CONFIGURE_AZURE");
|
var configureForAzureValue = Environment.GetEnvironmentVariable("DOTNET_CONFIGURE_AZURE");
|
||||||
|
|
|
||||||
|
|
@ -57,32 +57,13 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.Tools
|
||||||
|
|
||||||
private static void TransformAspNetCore(XElement aspNetCoreElement, string appName, bool configureForAzure)
|
private static void TransformAspNetCore(XElement aspNetCoreElement, string appName, bool configureForAzure)
|
||||||
{
|
{
|
||||||
var appPath = Path.Combine(configureForAzure ? @"%home%\site" : "..", appName);
|
var appPath = Path.Combine(configureForAzure ? @"%home%\site" : ".", appName);
|
||||||
var logPath = Path.Combine(configureForAzure ? @"\\?\%home%\LogFiles" : @"..\logs", "stdout.log");
|
var logPath = Path.Combine(configureForAzure ? @"\\?\%home%\LogFiles" : @".\logs", "stdout.log");
|
||||||
|
|
||||||
aspNetCoreElement.SetAttributeValue("processPath", appPath);
|
aspNetCoreElement.SetAttributeValue("processPath", appPath);
|
||||||
SetAttributeValueIfEmpty(aspNetCoreElement, "stdoutLogEnabled", "false");
|
SetAttributeValueIfEmpty(aspNetCoreElement, "stdoutLogEnabled", "false");
|
||||||
SetAttributeValueIfEmpty(aspNetCoreElement, "stdoutLogFile", logPath);
|
SetAttributeValueIfEmpty(aspNetCoreElement, "stdoutLogFile", logPath);
|
||||||
SetAttributeValueIfEmpty(aspNetCoreElement, "startupTimeLimit", "3600");
|
SetAttributeValueIfEmpty(aspNetCoreElement, "startupTimeLimit", "3600");
|
||||||
|
|
||||||
AddApplicationBase(aspNetCoreElement);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void AddApplicationBase(XElement aspNetCoreElement)
|
|
||||||
{
|
|
||||||
const string contentRootKeyName = "ASPNETCORE_CONTENTROOT";
|
|
||||||
|
|
||||||
var envVariables = GetOrCreateChild(aspNetCoreElement, "environmentVariables");
|
|
||||||
var appBaseElement = envVariables.Elements("environmentVariable").SingleOrDefault(e =>
|
|
||||||
string.Equals((string)e.Attribute("name"), contentRootKeyName, StringComparison.CurrentCultureIgnoreCase));
|
|
||||||
|
|
||||||
if (appBaseElement == null)
|
|
||||||
{
|
|
||||||
appBaseElement = new XElement("environmentVariable", new XAttribute("name", contentRootKeyName));
|
|
||||||
envVariables.AddFirst(appBaseElement);
|
|
||||||
}
|
|
||||||
|
|
||||||
appBaseElement.SetAttributeValue("value", ".");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static XElement GetOrCreateChild(XElement parent, string childName)
|
private static XElement GetOrCreateChild(XElement parent, string childName)
|
||||||
|
|
|
||||||
|
|
@ -18,15 +18,14 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.Tools.Tests
|
||||||
[Fact]
|
[Fact]
|
||||||
public void PublishIIS_uses_default_values_if_options_not_specified()
|
public void PublishIIS_uses_default_values_if_options_not_specified()
|
||||||
{
|
{
|
||||||
var webRoot = "wwwroot";
|
var folders = CreateTestDir("{}");
|
||||||
var folders = CreateTestDir("{}", webRoot);
|
|
||||||
|
|
||||||
new PublishIISCommand(folders.PublishOutput, folders.ProjectPath, null).Run();
|
new PublishIISCommand(folders.PublishOutput, folders.ProjectPath).Run();
|
||||||
|
|
||||||
var processPath = (string)GetPublishedWebConfig(folders.PublishOutput, webRoot)
|
var processPath = (string)GetPublishedWebConfig(folders.PublishOutput)
|
||||||
.Descendants("aspNetCore").Attributes("processPath").Single();
|
.Descendants("aspNetCore").Attributes("processPath").Single();
|
||||||
|
|
||||||
Assert.Equal($@"..\projectDir.exe", processPath);
|
Assert.Equal($@".\projectDir.exe", processPath);
|
||||||
|
|
||||||
Directory.Delete(folders.TestRoot, recursive: true);
|
Directory.Delete(folders.TestRoot, recursive: true);
|
||||||
}
|
}
|
||||||
|
|
@ -36,49 +35,14 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.Tools.Tests
|
||||||
[InlineData("awesome.App")]
|
[InlineData("awesome.App")]
|
||||||
public void PublishIIS_reads_application_name_from_project_json_if_exists(string projectName)
|
public void PublishIIS_reads_application_name_from_project_json_if_exists(string projectName)
|
||||||
{
|
{
|
||||||
var webRoot = "wwwroot";
|
var folders = CreateTestDir($@"{{ ""name"": ""{projectName}"" }}");
|
||||||
var folders = CreateTestDir($@"{{ ""name"": ""{projectName}"" }}", webRoot);
|
|
||||||
|
|
||||||
new PublishIISCommand(folders.PublishOutput, folders.ProjectPath, null).Run();
|
new PublishIISCommand(folders.PublishOutput, folders.ProjectPath).Run();
|
||||||
|
|
||||||
var processPath = (string)GetPublishedWebConfig(folders.PublishOutput, webRoot)
|
var processPath = (string)GetPublishedWebConfig(folders.PublishOutput)
|
||||||
.Descendants("aspNetCore").Attributes("processPath").Single();
|
.Descendants("aspNetCore").Attributes("processPath").Single();
|
||||||
|
|
||||||
Assert.Equal($@"..\{projectName}.exe", processPath);
|
Assert.Equal($@".\{projectName}.exe", processPath);
|
||||||
|
|
||||||
Directory.Delete(folders.TestRoot, recursive: true);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void PublishIIS_uses_webroot_from_hosting_json()
|
|
||||||
{
|
|
||||||
var webRoot = "mywebroot";
|
|
||||||
var folders = CreateTestDir("{}", webRoot);
|
|
||||||
File.WriteAllText(Path.Combine(folders.ProjectPath, "hosting.json"), $"{{ \"webroot\": \"{webRoot}\"}}");
|
|
||||||
|
|
||||||
new PublishIISCommand(folders.PublishOutput, folders.ProjectPath, null).Run();
|
|
||||||
|
|
||||||
var processPath = (string)GetPublishedWebConfig(folders.PublishOutput, webRoot)
|
|
||||||
.Descendants("aspNetCore").Attributes("processPath").Single();
|
|
||||||
|
|
||||||
Assert.Equal(@"..\projectDir.exe", processPath);
|
|
||||||
|
|
||||||
Directory.Delete(folders.TestRoot, recursive: true);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void PublishIIS_webroot_switch_takes_precedence_over_hosting_json()
|
|
||||||
{
|
|
||||||
var webRoot = "mywebroot";
|
|
||||||
var folders = CreateTestDir("{}", webRoot);
|
|
||||||
File.WriteAllText(Path.Combine(folders.ProjectPath, "hosting.json"), $"{{ \"webroot\": \"wwwroot\"}}");
|
|
||||||
|
|
||||||
new PublishIISCommand(folders.PublishOutput, folders.ProjectPath, webRoot).Run();
|
|
||||||
|
|
||||||
var processPath = (string)GetPublishedWebConfig(folders.PublishOutput, webRoot)
|
|
||||||
.Descendants("aspNetCore").Attributes("processPath").Single();
|
|
||||||
|
|
||||||
Assert.Equal(@"..\projectDir.exe", processPath);
|
|
||||||
|
|
||||||
Directory.Delete(folders.TestRoot, recursive: true);
|
Directory.Delete(folders.TestRoot, recursive: true);
|
||||||
}
|
}
|
||||||
|
|
@ -88,15 +52,14 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.Tools.Tests
|
||||||
[InlineData("project.Dir")]
|
[InlineData("project.Dir")]
|
||||||
public void PublishIIS_accepts_path_to_project_json_as_project_path(string projectDir)
|
public void PublishIIS_accepts_path_to_project_json_as_project_path(string projectDir)
|
||||||
{
|
{
|
||||||
var webRoot = "wwwroot";
|
var folders = CreateTestDir("{}", projectDir);
|
||||||
var folders = CreateTestDir("{}", webRoot, projectDir);
|
|
||||||
|
|
||||||
new PublishIISCommand(folders.PublishOutput, Path.Combine(folders.ProjectPath, "project.json"), null).Run();
|
new PublishIISCommand(folders.PublishOutput, Path.Combine(folders.ProjectPath, "project.json")).Run();
|
||||||
|
|
||||||
var processPath = (string)GetPublishedWebConfig(folders.PublishOutput, webRoot)
|
var processPath = (string)GetPublishedWebConfig(folders.PublishOutput)
|
||||||
.Descendants("aspNetCore").Attributes("processPath").Single();
|
.Descendants("aspNetCore").Attributes("processPath").Single();
|
||||||
|
|
||||||
Assert.Equal($@"..\{projectDir}.exe", processPath);
|
Assert.Equal($@".\{projectDir}.exe", processPath);
|
||||||
|
|
||||||
Directory.Delete(folders.TestRoot, recursive: true);
|
Directory.Delete(folders.TestRoot, recursive: true);
|
||||||
}
|
}
|
||||||
|
|
@ -104,10 +67,9 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.Tools.Tests
|
||||||
[Fact]
|
[Fact]
|
||||||
public void PublishIIS_modifies_existing_web_config()
|
public void PublishIIS_modifies_existing_web_config()
|
||||||
{
|
{
|
||||||
var webRoot = "wwwroot";
|
var folders = CreateTestDir("{}");
|
||||||
var folders = CreateTestDir("{}", webRoot);
|
|
||||||
|
|
||||||
File.WriteAllText(Path.Combine(folders.PublishOutput, webRoot, "web.config"),
|
File.WriteAllText(Path.Combine(folders.PublishOutput, "web.config"),
|
||||||
@"<configuration>
|
@"<configuration>
|
||||||
<system.webServer>
|
<system.webServer>
|
||||||
<handlers>
|
<handlers>
|
||||||
|
|
@ -117,35 +79,33 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.Tools.Tests
|
||||||
</system.webServer>
|
</system.webServer>
|
||||||
</configuration>");
|
</configuration>");
|
||||||
|
|
||||||
new PublishIISCommand(folders.PublishOutput, Path.Combine(folders.ProjectPath, "project.json"), null).Run();
|
new PublishIISCommand(folders.PublishOutput, Path.Combine(folders.ProjectPath, "project.json")).Run();
|
||||||
|
|
||||||
var aspNetCoreElement = GetPublishedWebConfig(folders.PublishOutput, webRoot)
|
var aspNetCoreElement = GetPublishedWebConfig(folders.PublishOutput)
|
||||||
.Descendants("aspNetCore").Single();
|
.Descendants("aspNetCore").Single();
|
||||||
|
|
||||||
Assert.Equal(@"..\projectDir.exe", (string)aspNetCoreElement.Attribute("processPath"));
|
Assert.Equal(@".\projectDir.exe", (string)aspNetCoreElement.Attribute("processPath"));
|
||||||
Assert.Equal(@"1234", (string)aspNetCoreElement.Attribute("startupTimeLimit"));
|
Assert.Equal(@"1234", (string)aspNetCoreElement.Attribute("startupTimeLimit"));
|
||||||
|
|
||||||
Directory.Delete(folders.TestRoot, recursive: true);
|
Directory.Delete(folders.TestRoot, recursive: true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private XDocument GetPublishedWebConfig(string publishOut, string webRoot)
|
private XDocument GetPublishedWebConfig(string publishOut)
|
||||||
{
|
{
|
||||||
return XDocument.Load(Path.Combine(publishOut, webRoot, "web.config"));
|
return XDocument.Load(Path.Combine(publishOut, "web.config"));
|
||||||
}
|
}
|
||||||
|
|
||||||
private Folders CreateTestDir(string projectJson, string webRoot, string projectDir = "projectDir")
|
private Folders CreateTestDir(string projectJson, string projectDir = "projectDir")
|
||||||
{
|
{
|
||||||
var testRoot = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());
|
var testRoot = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());
|
||||||
Directory.CreateDirectory(testRoot);
|
Directory.CreateDirectory(testRoot);
|
||||||
|
|
||||||
var projectPath = Path.Combine(testRoot, projectDir);
|
var projectPath = Path.Combine(testRoot, projectDir);
|
||||||
Directory.CreateDirectory(projectPath);
|
Directory.CreateDirectory(projectPath);
|
||||||
Directory.CreateDirectory(Path.Combine(projectPath, webRoot));
|
|
||||||
File.WriteAllText(Path.Combine(projectPath, "project.json"), projectJson);
|
File.WriteAllText(Path.Combine(projectPath, "project.json"), projectJson);
|
||||||
|
|
||||||
var publishOut = Path.Combine(testRoot, "publishOut");
|
var publishOut = Path.Combine(testRoot, "publishOut");
|
||||||
Directory.CreateDirectory(publishOut);
|
Directory.CreateDirectory(publishOut);
|
||||||
Directory.CreateDirectory(Path.Combine(publishOut, webRoot));
|
|
||||||
|
|
||||||
return new Folders { TestRoot = testRoot, ProjectPath = projectPath, PublishOutput = publishOut };
|
return new Folders { TestRoot = testRoot, ProjectPath = projectPath, PublishOutput = publishOut };
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,11 +12,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.Tools.Tests
|
||||||
<handlers>
|
<handlers>
|
||||||
<add name=""aspNetCore"" path=""*"" verb=""*"" modules=""AspNetCoreModule"" resourceType=""Unspecified""/>
|
<add name=""aspNetCore"" path=""*"" verb=""*"" modules=""AspNetCoreModule"" resourceType=""Unspecified""/>
|
||||||
</handlers>
|
</handlers>
|
||||||
<aspNetCore processPath=""..\test.exe"" stdoutLogEnabled=""false"" stdoutLogFile=""..\logs\stdout.log"" startupTimeLimit=""3600"">
|
<aspNetCore processPath="".\test.exe"" stdoutLogEnabled=""false"" stdoutLogFile="".\logs\stdout.log"" startupTimeLimit=""3600""/>
|
||||||
<environmentVariables>
|
|
||||||
<environmentVariable name=""ASPNETCORE_CONTENTROOT"" value=""."" />
|
|
||||||
</environmentVariables>
|
|
||||||
</aspNetCore>
|
|
||||||
</system.webServer>
|
</system.webServer>
|
||||||
</configuration>");
|
</configuration>");
|
||||||
|
|
||||||
|
|
@ -79,7 +75,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.Tools.Tests
|
||||||
(string)WebConfigTransform.Transform(WebConfigTemplate, "app.exe", configureForAzure: false)
|
(string)WebConfigTransform.Transform(WebConfigTemplate, "app.exe", configureForAzure: false)
|
||||||
.Descendants("aspNetCore").Single().Attribute("processPath");
|
.Descendants("aspNetCore").Single().Attribute("processPath");
|
||||||
|
|
||||||
Assert.Equal(@"..\app.exe", newProcessPath);
|
Assert.Equal(@".\app.exe", newProcessPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
|
|
@ -99,7 +95,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.Tools.Tests
|
||||||
new XElement("environmentVariable", new XAttribute("name", "ENVVAR"), new XAttribute("value", "123"));
|
new XElement("environmentVariable", new XAttribute("name", "ENVVAR"), new XAttribute("value", "123"));
|
||||||
|
|
||||||
var input = WebConfigTemplate;
|
var input = WebConfigTemplate;
|
||||||
input.Descendants("environmentVariable").Single().Add(envVarElement);
|
input.Descendants("aspNetCore").Single().Add(envVarElement);
|
||||||
|
|
||||||
Assert.True(XNode.DeepEquals(envVarElement,
|
Assert.True(XNode.DeepEquals(envVarElement,
|
||||||
WebConfigTransform.Transform(input, "app.exe", configureForAzure: false)
|
WebConfigTransform.Transform(input, "app.exe", configureForAzure: false)
|
||||||
|
|
@ -134,7 +130,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.Tools.Tests
|
||||||
}
|
}
|
||||||
|
|
||||||
Assert.Equal(
|
Assert.Equal(
|
||||||
@"..\logs\stdout.log",
|
@".\logs\stdout.log",
|
||||||
(string)WebConfigTransform.Transform(input, "test.exe", configureForAzure: false)
|
(string)WebConfigTransform.Transform(input, "test.exe", configureForAzure: false)
|
||||||
.Descendants().Attributes("stdoutLogFile").Single());
|
.Descendants().Attributes("stdoutLogFile").Single());
|
||||||
}
|
}
|
||||||
|
|
@ -177,16 +173,6 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.Tools.Tests
|
||||||
aspNetCoreElement));
|
aspNetCoreElement));
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void WebConfigTransform_overrites_value_for_ASPNET_APPLICATIONBASE()
|
|
||||||
{
|
|
||||||
var input = WebConfigTemplate;
|
|
||||||
input.Descendants("environmentVariable").Single().SetAttributeValue("value", "abc");
|
|
||||||
|
|
||||||
Assert.True(XNode.DeepEquals(WebConfigTemplate,
|
|
||||||
WebConfigTransform.Transform(input, "test.exe", configureForAzure: false)));
|
|
||||||
}
|
|
||||||
|
|
||||||
private bool VerifyMissingElementCreated(params string[] elementNames)
|
private bool VerifyMissingElementCreated(params string[] elementNames)
|
||||||
{
|
{
|
||||||
var input = WebConfigTemplate;
|
var input = WebConfigTemplate;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue