WPF 应用程序 exe 在 C: 上导致问题
我有一个非常奇怪的问题。我用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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
简单
构建>发布 x
选择您的位置
,然后单击
确保它是独立的且 win-x64
这可确保包含所有内容直接在exe中而不依赖.NET
Easy
Build > Publish x
Select your location
then click
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