Wenn ich versuche, im Debug- oder Release-Modus auszuführen, erhalte ich nur folgende Informationen:
Das Programm „[25648] MyApp.exe“ wurde mit Code 0 (0x0) beendet.
Wie kann ich das Problem weiter beheben?
Sogar die 1. Zeile der Klasse oder die 1. Zeile der Main()-Methode wird nicht erreicht (unter Verwendung eines Haltepunkts):
Code: Select all
private static string test1 = "STOP HERE";
mutex = new Mutex(true, AppName, out bool createdNew);
Code: Select all
static class Program
{
private static string test1 = "STOP HERE";
const string AppName = "MyApp";
private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private static Mutex mutex = null;
///
/// The main entry point for the application.
///
[STAThread]
static void Main(string[] args)
{
mutex = new Mutex(true, AppName, out bool createdNew);
if (!createdNew)
{
MessageBox.Show("MyApp is already running.", KwikConstants.AppName, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); //app is already running! Exiting the application
Application.Exit();
}
}
}
.Net 8.5 Framework
Es gibt keine PreBuild-Skripte.
Ich habe es in x64 versucht, x86 und jede CPU.
Ich habe alle NuGet-Pakete aktualisiert.
Die vollständige Lösung lässt sich ohne Fehler erstellen.
Mein PC-Betriebssystem ist Windows 11 23H2
Ich habe versucht, die EXE-Datei zu meinem Antivirus-Ausschluss hinzuzufügen und habe beim Testen sogar AV deaktiviert.
Irgendwelche Vorschläge zur Behebung des Problems Wäre sehr dankbar.