System.IO.FileNotFoundException.在哪里找到错误的路径? [英] System.IO.FileNotFoundException. Where do I find what path is wrong?

查看:248
本文介绍了System.IO.FileNotFoundException.在哪里找到错误的路径?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在VisualStudio2010中创建了小型Windows Forms程序,只是出于爱好.释放它们后,我使用.exe文件在其他PC上运行它们,而无需 进行任何安装.这些PC运行Windows OS(7,vista,XP).我编写代码的PC具有Win XP,并且编程序可以随时正常工作.

I create small Windows Forms progs in VisualStudio2010, just for hobby. After releasing them I use the .exe file to run them on other PCs, without having to do any installation. Those PCs run Windows OS(7,vista,XP). The PC which I wrote the code had Win XP and the progs managed to work fine anytime.

现在,我在另一台运行Win 8.1的PC上编写了另一个编,如上所述,每当我尝试在其他平台上运行发行的.exe时,都会收到以下错误消息.

Now I wrote another prog, on another PC, which runs Win 8.1 and I get the following error whenever I try to run the released .exe at other platforms, as mentioned above.

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

How can I locate what file is missing? tyvm

推荐答案

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/

Then I could see that the problem existed because Visual Basic Powerpack needed to be installed.I assume that machines without VS2010 installed,even if they have .NET 4.5, do not have that. The question is though, what was the difference this time and that package was needed IOT run the application.... The solution was found here actually, I need to say that. http://www.csharp-examples.net/catching-unhandled-exceptions/

这篇关于System.IO.FileNotFoundException.在哪里找到错误的路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆