我在VisualStudio2010中创建小型Windows Forms编程,仅用于爱好。在发布它们之后,我使用.exe文件在其他PC上运行它们,而没有 做任何安装。这些PC运行Windows操作系统(7,vista,XP)。我编写代码的PC有Win XP,并且编程随时都可以正常工作。
现在我在另一台运行Win 8.1的PC上编写了另一个prog,每当我尝试在其他平台上运行已发布的.exe时,我会收到以下错误,如上所述。
Problem signature: Problem Event Name: CLR20r3 Problem Signature 01: dmg_ors.exe Problem Signature 02: 1.0.0.0 Problem Signature 03: 52f4bad1 Problem Signature 04: DMG_ORS Problem Signature 05: 1.0.0.0 Problem Signature 06: 52f4bad1 Problem Signature 07: 3 Problem Signature 08: c Problem Signature 09: System.IO.FileNotFoundException OS Version: 6.1.7601.2.1.0.256.48 Locale ID: 1033 Additional Information 1: 82e2 Additional Information 2: 82e23b36efee975bd0e9417ff09fe7bb Additional Information 3: a1d6 Additional Information 4: a1d6e932d2c942475edff9f8fe05b46c Read our privacy statement online: http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409 If the online privacy statement is not available, please read our privacy statement offline: C:\Windows\system32\en-US\erofflps.tx
如何找到丢失的文件? tyvm
答案 0 :(得分:8)
Problem solved.I had to modify my main,IOT to catch that exception and see what was actually missing.
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.ThreadException += new
ThreadExceptionEventHandler(Application_ThreadException);
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
Application.Run(new Form1());
}
static void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
{
MessageBox.Show(e.Exception.Message, "Unhandled Thread Exception");
// here you can log the exception ...
}
static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
MessageBox.Show((e.ExceptionObject as Exception).Message, "Unhandled UI Exception");
// here you can log the exception
}
然后我可以看到问题存在,因为需要安装Visual Basic Powerpack。我假设没有安装VS2010的机器,即使它们有.NET 4.5,也没有。问题是,这次有什么不同,需要包装IOT运行应用程序.... 实际上在这里找到了解决方案,我需要说。 http://www.csharp-examples.net/catching-unhandled-exceptions/