diff --git a/AzureWebsitesMigrationAssistant.csproj b/AzureWebsitesMigrationAssistant.csproj
index c1e0132..fb070c4 100644
--- a/AzureWebsitesMigrationAssistant.csproj
+++ b/AzureWebsitesMigrationAssistant.csproj
@@ -1,4 +1,4 @@
-
+
@@ -7,7 +7,7 @@
Properties
CompatCheckAndMigrate
CompatCheckAndMigrate
- v3.5
+ v4.5
512
SAK
@@ -46,6 +46,7 @@
TRACE
prompt
4
+ false
AnyCPU
@@ -55,23 +56,19 @@
DEBUG;TRACE
prompt
4
+ false
66F37E5E7A4849038BD69132CB37CBB8CCEE8B85
- AzureWebsitesMigrationAssistant_TemporaryKey.pfx
+ false
- true
-
-
- true
-
-
- true
+ false
+
false
@@ -82,6 +79,12 @@
+
+ LocalIntranet
+
+
+ Properties\app.manifest
+
False
@@ -212,6 +215,7 @@
+
@@ -311,10 +315,8 @@
Designer
-
- Always
-
+
SettingsSingleFileGenerator
Settings.Designer.cs
@@ -369,4 +371,4 @@
-->
-
\ No newline at end of file
+
diff --git a/Controls/AddRemoteServers.cs b/Controls/AddRemoteServers.cs
index 8fc18ff..ecaa0a4 100644
--- a/Controls/AddRemoteServers.cs
+++ b/Controls/AddRemoteServers.cs
@@ -34,7 +34,7 @@ public void SetState(object state, bool isNavigatingBack = false)
this.useScom = false;
}
- MainForm.WriteTrace("in set state remote");
+ TraceHelper.Tracer.WriteTrace("in set state remote");
cbxDrive.SelectedIndex = 0;
if (this.useScom)
{
diff --git a/Controls/ContentAndDbMigrationControl.Designer.cs b/Controls/ContentAndDbMigrationControl.Designer.cs
index 807a16b..cfd0629 100644
--- a/Controls/ContentAndDbMigrationControl.Designer.cs
+++ b/Controls/ContentAndDbMigrationControl.Designer.cs
@@ -39,6 +39,7 @@ private void InitializeComponent()
this.feedbackButton = new System.Windows.Forms.Button();
this.btnClose = new System.Windows.Forms.Button();
this.statusPanel = new System.Windows.Forms.Panel();
+ this.button1 = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.progressPictureBox)).BeginInit();
this.SuspendLayout();
//
@@ -133,11 +134,27 @@ private void InitializeComponent()
this.statusPanel.Size = new System.Drawing.Size(922, 397);
this.statusPanel.TabIndex = 30;
//
+ // button1
+ //
+ this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
+ this.button1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(203)))), ((int)(((byte)(234)))));
+ this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+ this.button1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.button1.ForeColor = System.Drawing.Color.White;
+ this.button1.Location = new System.Drawing.Point(313, 516);
+ this.button1.Name = "button1";
+ this.button1.Size = new System.Drawing.Size(102, 41);
+ this.button1.TabIndex = 37;
+ this.button1.Text = "Open Log";
+ this.button1.UseVisualStyleBackColor = false;
+ this.button1.Click += new System.EventHandler(this.button1_Click);
+ //
// ContentAndDbMigrationControl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.White;
+ this.Controls.Add(this.button1);
this.Controls.Add(this.statusPanel);
this.Controls.Add(this.btnClose);
this.Controls.Add(this.feedbackButton);
@@ -163,5 +180,6 @@ private void InitializeComponent()
private System.Windows.Forms.Button feedbackButton;
private System.Windows.Forms.Button btnClose;
private System.Windows.Forms.Panel statusPanel;
+ private System.Windows.Forms.Button button1;
}
}
diff --git a/Controls/ContentAndDbMigrationControl.cs b/Controls/ContentAndDbMigrationControl.cs
index 988e02e..dca7292 100644
--- a/Controls/ContentAndDbMigrationControl.cs
+++ b/Controls/ContentAndDbMigrationControl.cs
@@ -5,6 +5,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
+using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Windows.Forms;
@@ -72,12 +73,12 @@ public void UpdateProgressbar(string serverAndSiteName)
PublishStatus pubStatus;
if (_publishControlMap.TryGetValue(serverAndSiteName, out pubStatus))
{
- MainForm.WriteTrace("Incrementing progress bar for {0}", serverAndSiteName);
+ TraceHelper.Tracer.WriteTrace("Incrementing progress bar for {0}", serverAndSiteName);
pubStatus.PerformStep();
}
else
{
- MainForm.WriteTrace("Not Incrementing progress bar for {0} since status control was not found", serverAndSiteName);
+ TraceHelper.Tracer.WriteTrace("Not Incrementing progress bar for {0} since status control was not found", serverAndSiteName);
}
}
@@ -93,12 +94,12 @@ public void SetProgressbarMax(string serverAndSiteName, int maxValue)
pubStatus.PerformStep();
}
- MainForm.WriteTrace("Setting progress bar max for {0} to {1}", serverAndSiteName, maxValue);
+ TraceHelper.Tracer.WriteTrace("Setting progress bar max for {0} to {1}", serverAndSiteName, maxValue);
pubStatus.UpdateMaxProgressBarvalue(maxValue);
}
else
{
- MainForm.WriteTrace("Not setting progress bar max for {0} to {1} since status control was not found", serverAndSiteName, maxValue);
+ TraceHelper.Tracer.WriteTrace("Not setting progress bar max for {0} to {1} since status control was not found", serverAndSiteName, maxValue);
}
}
@@ -107,12 +108,12 @@ public void SetContentPublished(string serverAndSiteName, bool success)
PublishStatus pubStatus;
if (_publishControlMap.TryGetValue(serverAndSiteName, out pubStatus))
{
- MainForm.WriteTrace("Setting content publish completion for {0} to {1}", serverAndSiteName, success);
+ TraceHelper.Tracer.WriteTrace("Setting content publish completion for {0} to {1}", serverAndSiteName, success);
pubStatus.ContentPublished(success);
}
else
{
- MainForm.WriteTrace("Not Setting content publish completion for {0} to {1} since control was not found", serverAndSiteName, success);
+ TraceHelper.Tracer.WriteTrace("Not Setting content publish completion for {0} to {1} since control was not found", serverAndSiteName, success);
}
}
@@ -121,7 +122,7 @@ public void SetDbPublished(string serverAndSiteName, bool success)
PublishStatus pubStatus;
if (_publishControlMap.TryGetValue(serverAndSiteName, out pubStatus))
{
- MainForm.WriteTrace("Setting db publish completion for {0} to {1}", serverAndSiteName, success);
+ TraceHelper.Tracer.WriteTrace("Setting db publish completion for {0} to {1}", serverAndSiteName, success);
pubStatus.DbPublished(success);
}
}
@@ -130,12 +131,12 @@ public void UpdateStatusLabel(string text)
{
if (lblStatus.InvokeRequired)
{
- MainForm.WriteTrace("Setting status label text to {0} via invoke", text);
+ TraceHelper.Tracer.WriteTrace("Setting status label text to {0} via invoke", text);
this.lblStatus.Invoke(new MethodInvoker(delegate() { this.lblStatus.Text = text; }));
}
else
{
- MainForm.WriteTrace("Setting status label text to {0}", text);
+ TraceHelper.Tracer.WriteTrace("Setting status label text to {0}", text);
this.lblStatus.Text = text;
}
}
@@ -157,7 +158,7 @@ private void TryDeployment(bool retry)
if (retry)
{
- MainForm.WriteTrace("Retrying ..");
+ TraceHelper.Tracer.WriteTrace("Retrying ..");
foreach (var server in this.IISServers.Servers.Values)
{
foreach (var site in server.Sites.Where(s => (!s.ContentPublishState || !s.DbPublishState)))
@@ -176,7 +177,7 @@ private void TryDeployment(bool retry)
}
else
{
- MainForm.WriteTrace("No control found for site: {0}", site.SiteName);
+ TraceHelper.Tracer.WriteTrace("No control found for site: {0}", site.SiteName);
}
}
}
@@ -197,7 +198,7 @@ private void TryDeployment(bool retry)
contentTraceFileName,
dbTraceFileName);
- MainForm.WriteTrace("Adding control to map for site: {0}", site.SiteName);
+ TraceHelper.Tracer.WriteTrace("Adding control to map for site: {0}", site.SiteName);
_publishControlMap[site.ServerName + site.SiteName] = pubStatus;
pubStatus.Dock = DockStyle.Top;
statusPanel.Controls.Add(pubStatus);
@@ -208,7 +209,7 @@ private void TryDeployment(bool retry)
PublishStatus pubStatus;
if (!_publishControlMap.TryGetValue(site.ServerName + site.SiteName, out pubStatus))
{
- MainForm.WriteTrace("Adding control to map for site: {0} with site or db creation error", site.SiteName);
+ TraceHelper.Tracer.WriteTrace("Adding control to map for site: {0} with site or db creation error", site.SiteName);
pubStatus = new PublishStatus(site.SiteName, site.SiteCreationError);
_publishControlMap[site.ServerName + site.SiteName] = pubStatus;
pubStatus.Dock = DockStyle.Top;
@@ -230,14 +231,14 @@ private void TryDeployment(bool retry)
{
if (!site.ContentPublishState)
{
- MainForm.WriteTrace("Queuing operation for site: {0}", site.SiteName);
+ TraceHelper.Tracer.WriteTrace("Queuing operation for site: {0}", site.SiteName);
var operation = new PublishContentOperation(site, this);
manager.Enqueue(operation);
}
if (!site.DbPublishState)
{
- MainForm.WriteTrace("Queing another operation for db for site: {0}", site.SiteName);
+ TraceHelper.Tracer.WriteTrace("Queing another operation for db for site: {0}", site.SiteName);
manager.Enqueue(new PublishDbOperation(site, this));
}
}
@@ -247,36 +248,51 @@ private void TryDeployment(bool retry)
{
foreach (var server in this.IISServers.Servers.Values)
{
- foreach (var site in server.Sites.Where(s => s.PublishProfile != null && string.IsNullOrEmpty(s.SiteCreationError)))
+ foreach (var site in server.Sites)
{
+ if (site.PublishProfile == null)
+ {
+ TraceHelper.Tracer.WriteTrace("ERROR: Skipping publish, no publish profile found for site: {0}", site.SiteName);
+ TraceHelper.Tracer.WriteTrace("HINT: Make sure that the publish profile element for the site contains the attribute" +
+ " originalsitename=\"{0}:{1}\" attribute", server.Name, site.SiteName);
+ TraceHelper.Tracer.WriteTrace("For more information see: https://www.movemetothecloud.net/Faq#toc12");
+ continue;
+ }
+
+ if (string.IsNullOrEmpty(site.SiteCreationError))
+ {
+ TraceHelper.Tracer.WriteTrace("ERROR: Skipping publish, site creation error for site: {0}", site.SiteName);
+ TraceHelper.Tracer.WriteTrace("Site creation error: {0}", site.SiteCreationError);
+ continue;
+ }
- MainForm.WriteTrace("Queuing operation for site: {0}", site.SiteName);
+ TraceHelper.Tracer.WriteTrace("Queuing operation for site: {0}", site.SiteName);
var operation = new PublishContentOperation(site, this);
manager.Enqueue(operation);
if (operation.HasDatabase)
{
- MainForm.WriteTrace("Queing another operation for db for site: {0}", site.SiteName);
+ TraceHelper.Tracer.WriteTrace("Queing another operation for db for site: {0}", site.SiteName);
manager.Enqueue(new PublishDbOperation(site, this));
}
}
}
}
- MainForm.WriteTrace("Calling start");
+ TraceHelper.Tracer.WriteTrace("Calling start");
manager.StartProcessing();
- MainForm.WriteTrace("Caling Wait");
+ TraceHelper.Tracer.WriteTrace("Caling Wait");
manager.WaitForOperations();
};
_worker.RunWorkerCompleted += (object runWorkerCompletedSender, RunWorkerCompletedEventArgs runWorkerCompletedEventArgs) =>
{
- MainForm.WriteTrace("Wait complete. In worker completed");
+ TraceHelper.Tracer.WriteTrace("Wait complete. In worker completed");
this.progressPictureBox.Visible = false;
UpdateStatusLabel("Finished deploying");
if (runWorkerCompletedEventArgs.Error != null)
{
- MainForm.WriteTrace("Worker thread has errors {0}", runWorkerCompletedEventArgs.Error.Message);
+ TraceHelper.Tracer.WriteTrace("Worker thread has errors {0}", runWorkerCompletedEventArgs.Error.Message);
MessageBox.Show(runWorkerCompletedEventArgs.Error.Message);
}
@@ -330,5 +346,10 @@ private void btnBack_Click(object sender, EventArgs e)
{
FireGoToEvent(WizardSteps.SiteStep, this.IISServers, true);
}
+
+ private void button1_Click(object sender, EventArgs e)
+ {
+ Process.Start(TraceHelper.Tracer.TraceFile);
+ }
}
}
diff --git a/Controls/ContentAndDbMigrationControl.resx b/Controls/ContentAndDbMigrationControl.resx
index 7080a7d..1af7de1 100644
--- a/Controls/ContentAndDbMigrationControl.resx
+++ b/Controls/ContentAndDbMigrationControl.resx
@@ -112,9 +112,9 @@
2.0
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
\ No newline at end of file
diff --git a/Controls/InstallerControl.cs b/Controls/InstallerControl.cs
index 2005017..27c4604 100644
--- a/Controls/InstallerControl.cs
+++ b/Controls/InstallerControl.cs
@@ -48,6 +48,7 @@ public void UpdateInstallStatus(string productName, string status, bool isComple
catch (Exception ex)
{
_installHelper.LogInformation(ex.ToString());
+ TraceHelper.Tracer.WriteTrace(ex.ToString());
}
}
@@ -75,6 +76,7 @@ public void MarkAllProductsComplete()
}
catch (Exception ex)
{
+ TraceHelper.Tracer.WriteTrace(ex.ToString());
_installHelper.LogInformation(ex.ToString());
_installHelper.Dispose();
}
diff --git a/Controls/MigrationCandidatesControl.cs b/Controls/MigrationCandidatesControl.cs
index 4f54ca4..afc6327 100644
--- a/Controls/MigrationCandidatesControl.cs
+++ b/Controls/MigrationCandidatesControl.cs
@@ -365,9 +365,11 @@ private void SyncSelectedObjects(TreeNode selectedNode, bool nodeChecked)
}
catch (System.ArgumentException ex)
{
- MessageBox.Show("Invalid connection string.\r\n\r\nValid connection string should be like\r\n 'Data Source=; Initial Catalog=; Trusted_Connection='" );
+ string message = "Invalid connection string.\r\n\r\nValid connection string should be like\r\n 'Data Source=; Initial Catalog=; Trusted_Connection='";
+ MessageBox.Show(message);
selectedNode.Tag = "AddDB";
selectedNode.Checked = false;
+ TraceHelper.Tracer.WriteTrace(message);
return;
}
}
diff --git a/Controls/MigrationSite.cs b/Controls/MigrationSite.cs
index a3980f5..8279980 100644
--- a/Controls/MigrationSite.cs
+++ b/Controls/MigrationSite.cs
@@ -175,6 +175,7 @@ private void checkPublishSettingsTimer_Tick(object sender, EventArgs e)
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
+ TraceHelper.Tracer.WriteTrace(ex.ToString());
}
}
@@ -192,6 +193,7 @@ private void btnPublish_Click(object sender, EventArgs e)
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
+ TraceHelper.Tracer.WriteTrace(ex.ToString());
}
var wizardStep = Helper.IsWebDeployInstalled
@@ -243,6 +245,7 @@ private string GetPublishSettingsFromWebPage()
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
+ TraceHelper.Tracer.WriteTrace(ex.ToString());
}
}
diff --git a/Controls/PickPublishSettingsControl.cs b/Controls/PickPublishSettingsControl.cs
index a36b45c..9ee9583 100644
--- a/Controls/PickPublishSettingsControl.cs
+++ b/Controls/PickPublishSettingsControl.cs
@@ -61,10 +61,22 @@ private void BrowseButton_Click(object sender, EventArgs e)
private void SaveButton_Click(object sender, EventArgs e)
{
string path = this.locationTextBox.Text;
- string root = Path.GetDirectoryName(path);
- if(!Directory.Exists(root))
+ string root = string.Empty;
+ if (File.Exists(path))
+ {
+ root = Path.GetDirectoryName(path);
+ }
+ else
+ {
+ string message = string.Format("The file \"{0}\" does not exist", path);
+ MessageBox.Show(message, System.Windows.Forms.Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
+
+ return;
+ }
+
+ if (!Directory.Exists(root))
{
- string message = string.Format("The folder {0} does not exists", root);
+ string message = string.Format("The folder \"{0}\" does not exist", root);
MessageBox.Show(message, System.Windows.Forms.Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
@@ -87,6 +99,7 @@ private void SaveButton_Click(object sender, EventArgs e)
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
+ TraceHelper.Tracer.WriteTrace(ex.ToString());
}
var wizardStep = Helper.IsWebDeployInstalled
diff --git a/Controls/RemoteServerControl.cs b/Controls/RemoteServerControl.cs
index f576903..f42fe67 100644
--- a/Controls/RemoteServerControl.cs
+++ b/Controls/RemoteServerControl.cs
@@ -20,7 +20,7 @@ public RemoteServerControl()
public void SetState(object state, bool isNavigatingBack = false)
{
- MainForm.WriteTrace("in set state remote");
+ TraceHelper.Tracer.WriteTrace("in set state remote");
// select local by default
radioLocal.Select();
radioLocal.Checked = true;
diff --git a/Controls/SendFeedbackControl.cs b/Controls/SendFeedbackControl.cs
index 4379322..33f5664 100644
--- a/Controls/SendFeedbackControl.cs
+++ b/Controls/SendFeedbackControl.cs
@@ -138,6 +138,7 @@ private void checkMailSettingsTimer_Tick(object sender, EventArgs e)
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
+ TraceHelper.Tracer.WriteTrace(ex.ToString());
}
}
}
diff --git a/Controls/SiteStatusControl.Designer.cs b/Controls/SiteStatusControl.Designer.cs
index 98e4229..1e13975 100644
--- a/Controls/SiteStatusControl.Designer.cs
+++ b/Controls/SiteStatusControl.Designer.cs
@@ -31,6 +31,7 @@ private void InitializeComponent()
this.statusPanel = new System.Windows.Forms.Panel();
this.btnClose = new System.Windows.Forms.Button();
this.btnFeedback = new System.Windows.Forms.Button();
+ this.button1 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// statusPanel
@@ -74,11 +75,27 @@ private void InitializeComponent()
this.btnFeedback.UseVisualStyleBackColor = false;
this.btnFeedback.Click += new System.EventHandler(this.btnFeedback_Click);
//
+ // button1
+ //
+ this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
+ this.button1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(203)))), ((int)(((byte)(234)))));
+ this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+ this.button1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.button1.ForeColor = System.Drawing.Color.White;
+ this.button1.Location = new System.Drawing.Point(241, 409);
+ this.button1.Name = "button1";
+ this.button1.Size = new System.Drawing.Size(102, 41);
+ this.button1.TabIndex = 36;
+ this.button1.Text = "Open Log";
+ this.button1.UseVisualStyleBackColor = false;
+ this.button1.Click += new System.EventHandler(this.button1_Click);
+ //
// SiteStatusControl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.White;
+ this.Controls.Add(this.button1);
this.Controls.Add(this.btnClose);
this.Controls.Add(this.btnFeedback);
this.Controls.Add(this.statusPanel);
@@ -94,5 +111,6 @@ private void InitializeComponent()
private System.Windows.Forms.Panel statusPanel;
private System.Windows.Forms.Button btnClose;
private System.Windows.Forms.Button btnFeedback;
+ private System.Windows.Forms.Button button1;
}
}
diff --git a/Controls/SiteStatusControl.cs b/Controls/SiteStatusControl.cs
index aa25bbe..1076c05 100644
--- a/Controls/SiteStatusControl.cs
+++ b/Controls/SiteStatusControl.cs
@@ -1,4 +1,6 @@
using System;
+using System.Diagnostics;
+using System.IO;
using System.Linq;
using System.Windows.Forms;
using CompatCheckAndMigrate.Helpers;
@@ -65,5 +67,10 @@ private void SiteStatusControl_Load(object sender, EventArgs e)
}
}
}
+
+ private void button1_Click(object sender, EventArgs e)
+ {
+ Process.Start(TraceHelper.Tracer.TraceFile);
+ }
}
}
diff --git a/Controls/SiteStatusControl.resx b/Controls/SiteStatusControl.resx
index 7080a7d..1af7de1 100644
--- a/Controls/SiteStatusControl.resx
+++ b/Controls/SiteStatusControl.resx
@@ -112,9 +112,9 @@
2.0
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
\ No newline at end of file
diff --git a/Helpers/ConfigReader.cs b/Helpers/ConfigReader.cs
index f41cd3e..4fcd1db 100644
--- a/Helpers/ConfigReader.cs
+++ b/Helpers/ConfigReader.cs
@@ -155,6 +155,7 @@ private static void CheckSessionState(string pathToConfig, IISServer server)
{
// dont throw. Its ok if we dont get default document list. Let migration continue
MessageBox.Show(ex.ToString());
+ TraceHelper.Tracer.WriteTrace(ex.ToString());
}
}
private static List GetDefaultDocuments(string pathToConfig)
@@ -184,6 +185,7 @@ private static List GetDefaultDocuments(string pathToConfig)
{
// dont throw. Its ok if we dont get default document list. Let migration continue
MessageBox.Show(ex.ToString());
+ TraceHelper.Tracer.WriteTrace(ex.ToString());
}
return docList.Values.ToList();
diff --git a/Helpers/GacAssemblyDetector.cs b/Helpers/GacAssemblyDetector.cs
index 8e491af..01f3f90 100644
--- a/Helpers/GacAssemblyDetector.cs
+++ b/Helpers/GacAssemblyDetector.cs
@@ -60,7 +60,7 @@ public List GetGacedAssemblies()
}
catch (Exception ex)
{
- MainForm.WriteTrace(ex.ToString());
+ TraceHelper.Tracer.WriteTrace(ex.ToString());
}
if (fileList.Any())
diff --git a/Helpers/Helper.cs b/Helpers/Helper.cs
index 8498b4d..8bd71ee 100644
--- a/Helpers/Helper.cs
+++ b/Helpers/Helper.cs
@@ -51,8 +51,9 @@ public static bool IsComputerReachable(string computername)
Dns.GetHostEntry(computername);
return true;
}
- catch (Exception)
+ catch (Exception ex)
{
+ TraceHelper.Tracer.WriteTrace(ex.ToString());
}
return false;
@@ -140,7 +141,9 @@ public static string GetMsiFile(string url, string filename)
}
catch (Exception ex)
{
- MessageBox.Show(string.Format("Failed to download {0} from: {1} due to: {2}", filename, url, ex.ToString()));
+ string message = string.Format("Failed to download {0} from: {1} due to: {2}", filename, url, ex.ToString());
+ MessageBox.Show(message);
+ TraceHelper.Tracer.WriteTrace(message);
}
return path;
@@ -159,6 +162,7 @@ public static bool ExecuteFile(string path)
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
+ TraceHelper.Tracer.WriteTrace(ex.ToString());
}
return false;
@@ -205,6 +209,7 @@ public static bool SetRegistryValue(string path, string keyName, T valueToSet
catch (Exception ex)
{
exceptionMessage = ex.Message;
+ TraceHelper.Tracer.WriteTrace(ex.ToString());
}
return false;
@@ -488,6 +493,7 @@ public static string UpdateStatus(string sitename, string servername, bool dbSta
catch (Exception ex)
{
exceptionMsg = ex.ToString();
+ TraceHelper.Tracer.WriteTrace(ex.ToString());
}
numRetries++;
@@ -548,6 +554,7 @@ public static InstallHelper SetupInstall()
{
MessageBox.Show(ex.ToString());
helper.LogInformation(ex.ToString());
+ TraceHelper.Tracer.WriteTrace(ex.ToString());
}
return helper;
@@ -596,7 +603,7 @@ public static Collection RunCommand(string fullScript, Dictionary AppPools
public void SetPublishSetting(Dictionary siteErrorInfo, string publishSettingsFilePath, string serverName)
{
+ TraceHelper.Tracer.WriteTrace("Searching for publishing settings for server: " + serverName);
foreach (var site in this.Sites)
{
+ TraceHelper.Tracer.WriteTrace("Searching for publishing settings for site: " + site);
var publishSetting = new PublishSettings(publishSettingsFilePath, site.SiteName, serverName);
if (!publishSetting.Initialized)
{
@@ -95,6 +98,13 @@ public void SetPublishSetting(Dictionary siteErrorInfo, string p
site.SiteCreationError = siteError;
}
}
+
+ if (!publishSetting.Initialized)
+ {
+ string message = "ERROR: cannot find publishing settings for site: " + site;
+ MessageBox.Show(message);
+ TraceHelper.Tracer.WriteTrace(message);
+ }
}
}
}
diff --git a/Helpers/Impersonator.cs b/Helpers/Impersonator.cs
index 520754a..ab72080 100644
--- a/Helpers/Impersonator.cs
+++ b/Helpers/Impersonator.cs
@@ -32,6 +32,7 @@ public static IDisposable ImpersonateUser(RemoteSystemInfo systemInfo)
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
+ TraceHelper.Tracer.WriteTrace(ex.ToString());
}
return impersonator;
diff --git a/Helpers/MWDWrapper.cs b/Helpers/MWDWrapper.cs
index b1e8a47..fcfa862 100644
--- a/Helpers/MWDWrapper.cs
+++ b/Helpers/MWDWrapper.cs
@@ -83,10 +83,11 @@ public void LogTrace(string format, params object[] args)
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
+ TraceHelper.Tracer.WriteTrace(ex.ToString());
}
_writer.WriteLine(DateTime.Now + " : " + message);
- MainForm.WriteTrace(message);
+ TraceHelper.Tracer.WriteTrace(message);
}
public void TraceEventHandler(object sender, DeploymentTraceEventArgs traceEvent)
@@ -292,7 +293,8 @@ public override bool Publish(bool setSize)
}
catch (Exception ex)
{
- LogTrace("Error syncing content for site: {0}", _localSite.SiteName);
+ string message = string.Format("Error syncing content for site: {0}", _localSite.SiteName);
+ LogTrace(message);
LogTrace(ex.ToString());
publishSucceeded = false;
}
@@ -344,6 +346,7 @@ public static void InitializeDbProviderOptions()
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
+ TraceHelper.Tracer.WriteTrace(ex.ToString());
}
}
}
@@ -357,16 +360,17 @@ private static bool UseTrustedConnection(string dbConnectionString)
SqlConnectionStringBuilder connectionBuilder = new SqlConnectionStringBuilder(dbConnectionString);
if (connectionBuilder.IntegratedSecurity)
{
- MainForm.WriteTrace("Using trusted connection");
+ TraceHelper.Tracer.WriteTrace("Using trusted connection");
return true;
}
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
+ TraceHelper.Tracer.WriteTrace(ex.ToString());
}
- MainForm.WriteTrace("Not using trusted conn");
+ TraceHelper.Tracer.WriteTrace("Not using trusted conn");
return false;
}
diff --git a/Helpers/PublishManager.cs b/Helpers/PublishManager.cs
index a818498..13b56a2 100644
--- a/Helpers/PublishManager.cs
+++ b/Helpers/PublishManager.cs
@@ -29,17 +29,17 @@ internal class PublishManager
internal PublishManager()
{
- MainForm.WriteTrace("Initializing PublishManager");
+ TraceHelper.Tracer.WriteTrace("Initializing PublishManager");
_pendingPublishOperations = new Queue();
_completedOperations = new Queue();
_totalOperations = 0;
- MainForm.WriteTrace("Max Threads is {0}", Helper.MaxConcurrentThreads);
+ TraceHelper.Tracer.WriteTrace("Max Threads is {0}", Helper.MaxConcurrentThreads);
ThreadPool.SetMaxThreads(Helper.MaxConcurrentThreads, Helper.MaxConcurrentThreads);
}
internal void Enqueue(PublishOperation operation)
{
- MainForm.WriteTrace("Enqueueing {0}", operation.LocalSite.SiteName);
+ TraceHelper.Tracer.WriteTrace("Enqueueing {0}", operation.LocalSite.SiteName);
// no contention since enqueueing happens before processing has started
_pendingPublishOperations.Enqueue(operation);
}
@@ -47,7 +47,7 @@ internal void Enqueue(PublishOperation operation)
internal void StartProcessing()
{
_totalOperations = _pendingPublishOperations.Count;
- MainForm.WriteTrace("Total Operations at start: {0}", _totalOperations);
+ TraceHelper.Tracer.WriteTrace("Total Operations at start: {0}", _totalOperations);
_controllerThread = new Thread(Controller);
_controllerThread.Start();
}
@@ -56,22 +56,22 @@ internal void WaitForOperations()
{
while (_completedOperations.Count < _totalOperations)
{
- MainForm.WriteTrace("Waiting for operations to complete. Total Operations: {0}, Completed Operations: {1}", _totalOperations, _completedOperations.Count);
+ TraceHelper.Tracer.WriteTrace("Waiting for operations to complete. Total Operations: {0}, Completed Operations: {1}", _totalOperations, _completedOperations.Count);
Thread.Sleep(1000);
}
while (_completedOperations.Count > 0)
{
var operation = _completedOperations.Dequeue();
- MainForm.WriteTrace("Checking status for {0}", operation.LocalSite.SiteName);
+ TraceHelper.Tracer.WriteTrace("Checking status for {0}", operation.LocalSite.SiteName);
if (operation is PublishContentOperation)
{
- MainForm.WriteTrace("Setting content status {0} for {1}", operation.PublishStatus, operation.LocalSite.SiteName);
+ TraceHelper.Tracer.WriteTrace("Setting content status {0} for {1}", operation.PublishStatus, operation.LocalSite.SiteName);
operation.LocalSite.ContentPublishState = operation.PublishStatus;
}
else
{
- MainForm.WriteTrace("Setting db status {0} for {1}", operation.PublishStatus, operation.LocalSite.SiteName);
+ TraceHelper.Tracer.WriteTrace("Setting db status {0} for {1}", operation.PublishStatus, operation.LocalSite.SiteName);
operation.LocalSite.DbPublishState = operation.PublishStatus;
}
@@ -87,12 +87,12 @@ private void Controller()
if (operation is PublishContentOperation)
{
- MainForm.WriteTrace("Scheduling content for: {0}", operation.LocalSite.SiteName);
+ TraceHelper.Tracer.WriteTrace("Scheduling content for: {0}", operation.LocalSite.SiteName);
ThreadPool.QueueUserWorkItem(new WaitCallback(PublishContent), operation);
}
else if (operation is PublishDbOperation)
{
- MainForm.WriteTrace("Scheduling db for: {0}", operation.LocalSite.SiteName);
+ TraceHelper.Tracer.WriteTrace("Scheduling db for: {0}", operation.LocalSite.SiteName);
ThreadPool.QueueUserWorkItem(new WaitCallback(PublishDatabase), operation);
}
}
@@ -103,7 +103,7 @@ private void PublishContent(object operationData)
var operation = operationData as PublishContentOperation;
if (operation == null)
{
- MainForm.WriteTrace("Publish: Thread {0} did not find any operations to process although got scheduled", Thread.CurrentThread.ManagedThreadId);
+ TraceHelper.Tracer.WriteTrace("Publish: Thread {0} did not find any operations to process although got scheduled", Thread.CurrentThread.ManagedThreadId);
return;
}
@@ -120,6 +120,7 @@ private void PublishContent(object operationData)
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
+ TraceHelper.Tracer.WriteTrace(ex.ToString());
}
finally
{
@@ -136,24 +137,25 @@ private void PublishDatabase(object operationData)
var operation = operationData as PublishDbOperation;
if (operation == null)
{
- MainForm.WriteTrace("Publish: Thread {0} did not find any operations to process although got scheduled", Thread.CurrentThread.ManagedThreadId);
+ TraceHelper.Tracer.WriteTrace("Publish: Thread {0} did not find any operations to process although got scheduled", Thread.CurrentThread.ManagedThreadId);
return;
}
try
{
- MainForm.WriteTrace("Starting db publish for: {0} in Thread {1}", operation.LocalSite.SiteName, Thread.CurrentThread.ManagedThreadId);
+ TraceHelper.Tracer.WriteTrace("Starting db publish for: {0} in Thread {1}", operation.LocalSite.SiteName, Thread.CurrentThread.ManagedThreadId);
operation.Publish(false);
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
+ TraceHelper.Tracer.WriteTrace(ex.ToString());
}
finally
{
lock (_completedOperations)
{
- MainForm.WriteTrace("Enqueueing completion for: {0} in Thread {1}", operation.LocalSite.SiteName, Thread.CurrentThread.ManagedThreadId);
+ TraceHelper.Tracer.WriteTrace("Enqueueing completion for: {0} in Thread {1}", operation.LocalSite.SiteName, Thread.CurrentThread.ManagedThreadId);
_completedOperations.Enqueue(operation);
}
}
diff --git a/Helpers/PublishSettings.cs b/Helpers/PublishSettings.cs
index 46047d6..df80b84 100644
--- a/Helpers/PublishSettings.cs
+++ b/Helpers/PublishSettings.cs
@@ -71,7 +71,9 @@ public PublishSettings(string filePathOrXml, string siteName, string serverName)
}
catch (Exception ex)
{
- MessageBox.Show("Invalid Publish Settings File: " + ex.ToString());
+ string message = "Invalid Publish Settings File: " + ex.ToString();
+ MessageBox.Show(message);
+ TraceHelper.Tracer.WriteTrace(message);
}
}
@@ -147,6 +149,8 @@ internal void Load(XPathNavigator nav, string siteName)
catch (ArgumentException ex)
{
string mesg = string.Format("Invalid agent type. Valid options are '{0}'", string.Join(", ", Enum.GetNames(typeof(PublishSettingsRemoteAgent))));
+ TraceHelper.Tracer.WriteTrace(mesg);
+ TraceHelper.Tracer.WriteTrace(ex.ToString());
throw new Exception(mesg, ex);
}
}
diff --git a/Helpers/RemoteSystemInfo.cs b/Helpers/RemoteSystemInfo.cs
index 8f5981e..e37a4f7 100644
--- a/Helpers/RemoteSystemInfo.cs
+++ b/Helpers/RemoteSystemInfo.cs
@@ -53,6 +53,7 @@ public RemoteSystemInfo(string computerName, string username, string password, s
message += ex.Message;
MessageBox.Show(message, System.Windows.Forms.Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
this.Error = true;
+ TraceHelper.Tracer.WriteTrace(message);
}
this.IISVersion = 7;
this.OSVersion = "6.1";
@@ -70,6 +71,7 @@ public RemoteSystemInfo(string computerName, string username, string password, s
message += ex.Message;
MessageBox.Show(message, System.Windows.Forms.Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
this.Error = true;
+ TraceHelper.Tracer.WriteTrace(message);
}
this.IISVersion = 6;
@@ -108,6 +110,8 @@ public static void Initialize(string computerName, string username, string passw
}
catch (Exception ex)
{
+ TraceHelper.Tracer.WriteTrace("Unable to copy applicationhost.config");
+ TraceHelper.Tracer.WriteTrace(ex.ToString());
throw new Exception("Unable to copy applicationhost.config", ex);
}
remoteSystemInfo.IISVersion = 7;
@@ -122,6 +126,8 @@ public static void Initialize(string computerName, string username, string passw
}
catch (Exception ex)
{
+ TraceHelper.Tracer.WriteTrace("Unable to copy metabase.xml");
+ TraceHelper.Tracer.WriteTrace(ex.ToString());
throw new Exception("Unable to copy metabase.xml", ex);
}
remoteSystemInfo.IISVersion = 6;
diff --git a/Helpers/TraceHelper.cs b/Helpers/TraceHelper.cs
new file mode 100644
index 0000000..01d0547
--- /dev/null
+++ b/Helpers/TraceHelper.cs
@@ -0,0 +1,43 @@
+// Copyright (c) Microsoft Technologies, Inc. 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;
+
+namespace CompatCheckAndMigrate.Helpers
+{
+ public static class TraceHelper
+ {
+ public static Tracer Tracer { get; set; }
+ }
+
+ public class Tracer
+ {
+ public string TraceFile { get; set; }
+
+ public Tracer()
+ {
+ var path = Path.GetTempPath();
+ string traceFilename = "MigrationTrace-" + DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss") + ".txt";
+ TraceFile = Path.Combine(path, traceFilename);
+ }
+
+ public void WriteTrace(string format, params object[] args)
+ {
+ using (StreamWriter streamWriter = File.AppendText(this.TraceFile))
+ {
+ var message = format;
+ try
+ {
+ message = string.Format(format, args);
+ }
+ catch
+ {
+ }
+
+ streamWriter.WriteLine(DateTime.Now + " : " + message);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/MainForm.cs b/MainForm.cs
index 540eb42..f0a9851 100644
--- a/MainForm.cs
+++ b/MainForm.cs
@@ -19,9 +19,7 @@ namespace CompatCheckAndMigrate
public partial class MainForm : Form
{
private Control _previousControl = null;
- private Stream _traceStream;
- private TextWriterTraceListener _textListener;
-
+
private Dictionary _steps = new Dictionary()
{
{WizardSteps.FeedbackPage, new SendFeedbackControl()},
@@ -40,11 +38,7 @@ public partial class MainForm : Form
private void InitializeTrace()
{
- var path = Path.GetTempPath();
- _traceStream = File.Create(Path.Combine(path, "migrationTrace.log"));
- _textListener = new TextWriterTraceListener(_traceStream);
- Trace.Listeners.Add(_textListener);
- WriteTrace("Tracing Started");
+ TraceHelper.Tracer = new Tracer();
}
public MainForm()
@@ -58,16 +52,7 @@ public MainForm()
public static void WriteTrace(string format, params object[] args)
{
- var message = format;
- try
- {
- message = string.Format(format, args);
- }
- catch
- {
- }
-
- Trace.WriteLine(DateTime.Now + " : " + message);
+ TraceHelper.Tracer.WriteTrace(format, args);
}
private static void CheckAndSetBrowserEmulation()
@@ -156,9 +141,7 @@ private void GoToStep(WizardSteps step, object state, bool isNavigatingBack = fa
private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
{
- _traceStream.Flush();
- _textListener.Dispose();
- _traceStream.Dispose();
+
}
}
}
diff --git a/Program.cs b/Program.cs
index abf0f09..c1cfad5 100644
--- a/Program.cs
+++ b/Program.cs
@@ -7,6 +7,8 @@
using System.Reflection;
using System.Security.Principal;
using System.Windows.Forms;
+using CompatCheckAndMigrate.Helpers;
+using Application = System.Windows.Forms.Application;
namespace CompatCheckAndMigrate
{
@@ -33,6 +35,7 @@ private static void Main()
}
catch (Exception ex)
{
+ TraceHelper.Tracer.WriteTrace(ex.ToString());
MessageBox.Show(ex.ToString());
}
}
diff --git a/Properties/Resources.Designer.cs b/Properties/Resources.Designer.cs
index 0bfad32..9ddcd1c 100644
--- a/Properties/Resources.Designer.cs
+++ b/Properties/Resources.Designer.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
//
// This code was generated by a tool.
-// Runtime Version:4.0.30319.34014
+// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -9,6 +9,9 @@
//------------------------------------------------------------------------------
namespace CompatCheckAndMigrate.Properties {
+ using System;
+
+
///
/// A strongly-typed resource class, for looking up localized strings, etc.
///
diff --git a/Properties/Settings.Designer.cs b/Properties/Settings.Designer.cs
index 499f332..3eaabc5 100644
--- a/Properties/Settings.Designer.cs
+++ b/Properties/Settings.Designer.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
//
// This code was generated by a tool.
-// Runtime Version:4.0.30319.34014
+// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -12,7 +12,7 @@ namespace CompatCheckAndMigrate.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
diff --git a/Properties/app.manifest b/Properties/app.manifest
new file mode 100644
index 0000000..7e8ad37
--- /dev/null
+++ b/Properties/app.manifest
@@ -0,0 +1,54 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file