2014-02-07 67 views
8

我在VisualStudio2010中创建小型Windows窗体编程,仅用于爱好。释放它们之后,我使用.exe文件在其他PC上运行它们,而不需要 进行任何安装。那些电脑运行Windows操作系统(7,Vista,XP)。我编写代码的个人电脑上有Win XP,并且progs可以在任何时候正常工作。System.IO.FileNotFoundException。我在哪里可以找到哪条路是错误的?

现在我在另一台PC上编写了另一个prog,它运行的是Win 8.1,每当我尝试在其他平台上运行发布的.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

问题已解决,但我无法编辑问题... – Stelios

回答

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动力组需要的是installed.I假设没有VS2010的机器上安装,即使他们有.NET 4.5,做没有。问题是,这次有什么不同,这个包需要IOT运行应用程序.... 解决方案实际上在这里找到了,我需要说的是。 http://www.csharp-examples.net/catching-unhandled-exceptions/

相关问题