如果我在重新启动时启动我的应用程序,MyApp 将在几秒钟后崩溃

发布于 2024-10-10 04:12:48 字数 1284 浏览 0 评论 0原文

我在 Windows 7 上运行,但我的应用程序在启动时遇到问题。 在我的应用程序中,我使用一些线程和外部 dll(sqlite3.dll 等)。 我在 start.exe 文件的开头包含了这些行:

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);

如果我从 exe 文件(或使用 VisualStudio)手动启动我的应用程序,则可以正常工作。 如果我在重新启动时启动我的应用程序,MyApp 将在几秒钟后崩溃。

为什么我有这个问题?

编辑: 我附上了崩溃日志:

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

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

雪若未夕 2024-10-17 04:12:48

我们已经解决了我的问题。
仅供参考:如果您在应该在启动时启动的应用程序上使用 Directory.GetCurrentDirectory(),我们必须验证正确的路径(实际上是 Windows/系统)。

感谢您的帮助!通过动态调试,一切正常!

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!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文