From 9e3a8d1900748ae90310c290813b5034c175af5d Mon Sep 17 00:00:00 2001 From: Lex Li Date: Tue, 28 Mar 2023 01:27:56 -0400 Subject: [PATCH] Added IIS Express detection. --- JexusManager/MainForm.cs | 17 +++++++++++++++++ .../AspNetCoreHelper.cs | 3 +-- .../IisExpressServerManager.cs | 2 -- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/JexusManager/MainForm.cs b/JexusManager/MainForm.cs index ddeceaa..34b468e 100644 --- a/JexusManager/MainForm.cs +++ b/JexusManager/MainForm.cs @@ -266,6 +266,23 @@ private void LoadIisExpress() private void LoadIisExpressQuick(List files) { + if (!IisExpressServerManager.ServerInstalled) + { + var result = UIService.ShowMessage( + "Didn't find IIS Express on this machine. Do you want to install it now?", + "IIS Express not found", + MessageBoxButtons.YesNo, + MessageBoxIcon.Question, + MessageBoxDefaultButton.Button1); + if (result != DialogResult.Yes) + { + return; + } + + DialogHelper.ProcessStart("https://www.microsoft.com/download/details.aspx?id=48264"); + return; + } + if (files.Count == 0 && !File.Exists(DialogHelper.ListIisExpress)) { return; diff --git a/Microsoft.Web.Administration/AspNetCoreHelper.cs b/Microsoft.Web.Administration/AspNetCoreHelper.cs index 2bdd7ff..b172657 100644 --- a/Microsoft.Web.Administration/AspNetCoreHelper.cs +++ b/Microsoft.Web.Administration/AspNetCoreHelper.cs @@ -53,9 +53,8 @@ public static void FixConfigFile(string fileName) if (fixSection) { FixSection(doc); + doc.Save(fileName); } - - doc.Save(fileName); } private static void FixSite(XDocument xml, string siteName) diff --git a/Microsoft.Web.Administration/IisExpressServerManager.cs b/Microsoft.Web.Administration/IisExpressServerManager.cs index 3ecc44c..d9a7533 100644 --- a/Microsoft.Web.Administration/IisExpressServerManager.cs +++ b/Microsoft.Web.Administration/IisExpressServerManager.cs @@ -8,8 +8,6 @@ using System.Diagnostics; using System.IO; using System.Runtime.InteropServices; -using System.Xml.Linq; -using System.Xml.XPath; using Rollbar; using Exception = System.Exception;