This is fixed now. Following is the solution for the mentioned issue.
Application was crashing after downloading and before starting up. In order to pin point, I enclosed DispatcherUnhandedException
handler to know more about it. With following in place, I was able to nail down the exact exception from the log file. In my case, it was to do with virtual machine profile permission. It might be totally different in your case. However, this approach will give you a helping hand to filter the root cause.
<Application x:Class="xxxxxxxx.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="MainWindow.xaml" DispatcherUnhandledException="ApplicationDispatcherUnhandledException">
and
void ApplicationDispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
{
var theException = e.Exception;
var theErrorPath = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) +"\\IntraDataCopyError.txt";
using (System.IO.TextWriter theWriter = new System.IO.StreamWriter(theErrorPath, true))
{
var theNow = DateTime.Now;
theWriter.WriteLine("Error log at : " + theNow.ToShortDateString() + " " + theNow.ToShortTimeString());
while (theException != null)
{
theWriter.WriteLine("Exception: " + theException);
theException = theException.InnerException;
}
}
MessageBox.Show("The program aborted due to following issue.\n" + theErrorPath);
e.Handled = true;
Application.Current.Shutdown();
}