WPF app published as exe unhandled exception error

85 Views Asked by At

I have been trying to publish my WPF app as a standalone .exe instead of as a manifest. I've followed several posts from here and have added the following lines to the .csproj file:

<PropertyGroup>
    <PublishSingleFile>true</PublishSingleFile>
  </PropertyGroup>

But that didn't work. So as suggested by another user, I compiled my application as a console app in order to see any errors that are thrown. The console showed these errors:

enter image description here

The only reference to RED.APP is in my AppView.xml file here:


<Application x:Class="RED.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:local="clr-namespace:RED">

    <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary>
                    <local:Bootstrapper x:Key="Bootstrapper" />
                </ResourceDictionary>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Application.Resources>
</Application>

I'm using a bootstrapper because I am using CaliburnMicro, here is the bootstrapper class:


using System.Windows;
using Caliburn.Micro;
using RED.ViewModels;


namespace RED
{
    public class Bootstrapper : BootstrapperBase
    {
        public Bootstrapper() //Constructor
        {
            Initialize();
            LogManager.GetLog = type => new DebugLog(type);
            //Uses the output window in visual studio to display logging information it collects from Caliburn.Micro
        }

        //Override the startup method and launch the shell instead
        protected override void OnStartup(object sender, StartupEventArgs e)
        {
            DisplayRootViewFor<ShellViewModel>();
            
        }
    }
}

Is the error caused by CaliburnMicro? I am not sure what exactly the error is saying. I have resolved a couple of warnings about some references that weren't resolved, and have boiled it down to this last error and am stuck. The event viewer was showing errors 1000 and 1026 when I tried to launch the .exe. I'm not seeing any debug text in the output from Caliburn.

Thanks in advance for the assistance.

0

There are 0 best solutions below