Adding messages showing that the tool is running

This commit is contained in:
moozzyk 2016-02-09 10:19:38 -08:00
parent 971667e7da
commit edff3a563c
3 changed files with 19 additions and 7 deletions

View File

@ -2,6 +2,7 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System; using System;
using Microsoft.DotNet.Cli.Utils;
using Microsoft.Extensions.CommandLineUtils; using Microsoft.Extensions.CommandLineUtils;
namespace Microsoft.AspNetCore.Tools.PublishIIS namespace Microsoft.AspNetCore.Tools.PublishIIS
@ -32,7 +33,13 @@ namespace Microsoft.AspNetCore.Tools.PublishIIS
return 2; return 2;
} }
return new PublishIISCommand(publishFolder, projectPath.Value, webRootOption.Value()).Run(); Reporter.Output.WriteLine($"Configuring the following project for use with IIS: '{publishFolder}'");
var exitCode = new PublishIISCommand(publishFolder, projectPath.Value, webRootOption.Value()).Run();
Reporter.Output.WriteLine("Configuring project completed successfully");
return exitCode;
}); });
try try
@ -41,11 +48,8 @@ namespace Microsoft.AspNetCore.Tools.PublishIIS
} }
catch (Exception e) catch (Exception e)
{ {
#if DEBUG Reporter.Error.WriteLine(e.Message.Red());
Console.Error.WriteLine(e); Reporter.Verbose.WriteLine(e.ToString().Yellow());
#else
Console.Error.WriteLine(e.Message);
#endif
} }
return 1; return 1;

View File

@ -5,6 +5,7 @@ using System;
using System.IO; using System.IO;
using System.Xml; using System.Xml;
using System.Xml.Linq; using System.Xml.Linq;
using Microsoft.DotNet.Cli.Utils;
using Microsoft.DotNet.ProjectModel; using Microsoft.DotNet.ProjectModel;
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
@ -32,12 +33,18 @@ namespace Microsoft.AspNetCore.Tools.PublishIIS
var webConfigPath = Path.Combine(_publishFolder, webRoot, "web.config"); var webConfigPath = Path.Combine(_publishFolder, webRoot, "web.config");
if (File.Exists(webConfigPath)) if (File.Exists(webConfigPath))
{ {
Reporter.Output.WriteLine($"Updating web.config at '{webConfigPath}'");
try try
{ {
webConfigXml = XDocument.Load(webConfigPath); webConfigXml = XDocument.Load(webConfigPath);
} }
catch (XmlException) { } catch (XmlException) { }
} }
else
{
Reporter.Output.WriteLine($"No web.config found. Creating '{webConfigPath}'");
}
var applicationName = Path.ChangeExtension(GetApplicationName(applicationBasePath), "exe"); var applicationName = Path.ChangeExtension(GetApplicationName(applicationBasePath), "exe");
var transformedConfig = WebConfigTransform.Transform(webConfigXml, applicationName, ConfigureForAzure()); var transformedConfig = WebConfigTransform.Transform(webConfigXml, applicationName, ConfigureForAzure());

View File

@ -11,7 +11,8 @@
"NETStandard.Library": "1.0.0-*", "NETStandard.Library": "1.0.0-*",
"Microsoft.Extensions.CommandLineUtils": "1.0.0-*", "Microsoft.Extensions.CommandLineUtils": "1.0.0-*",
"Microsoft.Extensions.Configuration.Json": "1.0.0-*", "Microsoft.Extensions.Configuration.Json": "1.0.0-*",
"Microsoft.DotNet.ProjectModel": "1.0.0-*" "Microsoft.DotNet.ProjectModel": "1.0.0-*",
"Microsoft.DotNet.Cli.Utils": "1.0.0-*"
}, },
"frameworks": { "frameworks": {