WPF 应用程序 exe 在 C: 上导致问题

发布于 2025-01-11 21:46:59 字数 220 浏览 4 评论 0原文

我有一个非常奇怪的问题。我用WPF & 编写了一个程序。 C# 与 postgres 数据库。我在我的电脑上启动 exe,程序运行良好。然后我将调试文件夹复制到 USB。在另一台计算机上安装所有必需的网络框架、数据库等。然后我在那里启动程序,它启动并且我可以使用它,但是当我调用特定的 UserControl 时它崩溃了。现在奇怪的事情来了,如果我从 U 盘启动 exe,程序可以正常工作而不会崩溃。这可能是什么原因?

I have a very strange problem. I have written a program in WPF & C# with a postgres database. I start the exe on my pc the program works fine. Then I copy the debug folder to a USB. Install all necessary Netframework, the database etc. on another computer. Then I start the program there, it starts and I can use it but it crashes when I call a specific UserControl. Now comes the strange thing, if I start the exe from the USB stick, the program works fine without crashing. What can be the reason for this?

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

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

发布评论

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

评论(1

青巷忧颜 2025-01-18 21:46:59

简单

构建>发布 x

选择您的位置

,然后单击

在此处输入图像描述

在此处输入图像描述

确保它是独立的且 win-x64

这可确保包含所有内容直接在exe中而不依赖.NET

Easy

Build > Publish x

Select your location

then click

enter image description here

enter image description here

Make sure it is self-contained and win-x64

This makes sure all of the things are contained directly in the exe without relying on .NET

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