Search code examples
c#windows-7crashregistryboot

If I start my app on reboot, MyApp crashes after few seconds


I'm running on Windows 7 and I've a problem with my app at boot. Within my app I use some threads and external dll (sqlite3.dll, etc...). I've included these lines at first of my start.exe file:

RegistryKey rkApp = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);
String p = System.Environment.CommandLine.Replace("vshost.","");
String pp = p.Remove(p.Length-1);
rkApp.SetValue("MyAPP", pp);

If I start my app manually from exe file (or with VisualStudio) works correctly. If I start my app on reboot, MyApp crashes after few seconds.

Why I've this problem?

EDIT: I've attached crash log:

Descrizione
Percorso dell'applicazione che ha generato l'errore:    C:\Users\Francesco\DynInst\bin\start.exe

Firma del problema
Nome evento problema:   APPCRASH
Nome applicazione:  start.exe
Versione applicazione:  1.0.0.0
Timestamp applicazione: 4d2061b9
Nome modulo con errori: KERNELBASE.dll
Versione modulo con errori: 6.1.7600.16385
Timestamp modulo con errori:    4a5bdaae
Codice eccezione:   e0434f4d
Offset eccezione:   00009617
Versione SO:    6.1.7600.2.0.0.256.48
ID impostazioni locali: 1040
Informazioni aggiuntive 1:  0a9e
Ulteriori informazioni 2:   0a9e372d3b4ad19135b953a78882e789
Ulteriori informazioni 3:   0a9e
Ulteriori informazioni 4:   0a9e372d3b4ad19135b953a78882e789

Ulteriori informazioni sul problema
ID bucket:  2250313277

Solution

  • We have solved my issue. FYI: If you use Directory.GetCurrentDirectory() on application that should be start on boot, we have to verify correct path (actually is windows/system).

    Thanks for your help! With Dynamic debug all works correctly!