.NET 应用程序无法在 Windows 7 中打开
我在 Windows XP 上使用 Visual Studio 2010 创建了一个非常简单的 C# 应用程序。它在我的机器上编译、运行和调试都很好。我什至构建了它以供发布,并在我的机器和另一台 Windows XP 机器上完美运行 .exe。当我发送带有 .exe 文件的发布文件夹并且他们打开它时,什么也没有发生!没有错误或任何东西,只是空白!
安装了.NET 版本4框架
这是一个Windows窗体应用程序。
更新:来自OP对以下答案之一的评论的详细信息:
大家好,感谢您的想法。我 复制我在朋友身上发现的内容 windows 7机器事件日志和这个 是这样说的:
应用程序:ePrescribing.exe 框架版本:v4.0.30319
描述:该过程是
由于未处理而终止
例外。异常信息:
System.IO.FileNotFoundException 堆栈:
在
ePrescribing.frmApp.InitializeComponent()
在 ePrescribing.frmApp..ctor() 处
ePrescribing.Program.Main()错误应用程序名称:ePrescribing.exe,版本:1.0.0.0,
时间戳:0x4d61e693 故障模块
名称:KERNELBASE.dll,版本:
6.1.7600.16385,时间戳:0x4a5bdbdf 异常代码:0xe0434352 故障
偏移量:0x0000b727 故障过程
id: 0xb38 应用程序启动错误
时间:0x01cbe1dbe6d4ba2d 故障
申请路径:
C:\Users\Duane\Downloads\ePrescribing.exe
故障模块路径:
C:\Windows\syswow64\KERNELBASE.dll
报告编号:
266adc61-4dcf-11e0-8438-e0cb4e197cde –故障桶,类型 0 事件名称:CLR20r3 响应:不可用
出租车 ID:0 问题签名:P1:
eprescribing.exe P2: 1.0.0.0 P3:
4d61e693 P4:电子处方 P5:1.0.0.0
P6: 4d61e693 P7: 28 P8: e P9:
System.IO.FileNotFoundException P10: –我删除了唯一的区域
以为会有文件加载
(用于图片框加载 profile.jpg) 仍然得到相同的结果 错误。有什么想法吗?
I created a pretty simple c# application using visual studio 2010 on windows xp. It compiles, runs and debugs fine on my machine. I even built it for release and ran the .exe on my machine and another windows xp machine perfectly fine. When I send the release folder with the .exe file and they open it, nothing happens! No errors or anything, just blank!
.NET version 4 framework installed
It is a windows form application.
UPDATE: Details from OP's comments given to one of the answers below:
Hey everyone, thanks for the ideas. I
copied what I found on my friends
windows 7 machine event log and this
is what it said:Application: ePrescribing.exe Framework Version: v4.0.30319
Description: The process was
terminated due to an unhandled
exception. Exception Info:
System.IO.FileNotFoundException Stack:
at
ePrescribing.frmApp.InitializeComponent()
at ePrescribing.frmApp..ctor() at
ePrescribing.Program.Main()Faulting application name: ePrescribing.exe, version: 1.0.0.0,
time stamp: 0x4d61e693 Faulting module
name: KERNELBASE.dll, version:
6.1.7600.16385, time stamp: 0x4a5bdbdf Exception code: 0xe0434352 Fault
offset: 0x0000b727 Faulting process
id: 0xb38 Faulting application start
time: 0x01cbe1dbe6d4ba2d Faulting
application path:
C:\Users\Duane\Downloads\ePrescribing.exe
Faulting module path:
C:\Windows\syswow64\KERNELBASE.dll
Report Id:
266adc61-4dcf-11e0-8438-e0cb4e197cde –Fault bucket , type 0 Event Name: CLR20r3 Response: Not available
Cab Id: 0 Problem signature: P1:
eprescribing.exe P2: 1.0.0.0 P3:
4d61e693 P4: ePrescribing P5: 1.0.0.0
P6: 4d61e693 P7: 28 P8: e P9:
System.IO.FileNotFoundException P10: –I removed the only area where I
thought there would be a file load
(for the picturebox loading
profile.jpg) and still got the same
error. Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(8)
首先,您可以尝试检查事件查看器是否有任何相关错误消息(如上所述)。
接下来,确保他们安装了 .NET(如上所述)。
然后,尝试添加
First, you might try checking the Event Viewer for any relevant errors messages (as stated above).
Next, make sure they have .NET installed (as stated above).
Then, try adding an UnhandledExceptionEventHandler to your application and in that handler, try to at least write a simple log/text file containing the exception that caused your application to exit.
确保安装了最新的 .NET 框架。
Make sure the latest .NET framework is installed.
除了其他答案之外,我还会检查您的应用程序是否针对
x86/x64
运行时进行编译Additionly to other answers I would also check whether your app compiled against
x86/x64
runtime您是否包含清单文件?
看看这个。
enusbaum.com/blog/2007/08/26/how-to-run-your-c-application-as-administrator-in-windows-vista/" rel="nofollow">或者这个...
Have you included a manifest file?
Take a look at this.
Or this...
您是否通过静态路径而不是环境变量访问任何文件夹?这可能会导致这些版本的 Windows 之间出现问题。
Are you accessing any folders via static paths instead of environment variables? That could cause issues between these versions of Windows.
您应该检查是否可以在 GAC 或应用程序文件夹中找到所有其他第三方程序集
You should check if all other third party assemblies can be found either in GAC or app folder
目标计算机中可能缺少引用的程序集。请为所有引用的库设置Copy Local=True。这可能会解决您的问题。
Referenced assembly may be missing from target computer. Please set Copy Local=True for all referenced library. This may solve your issue.