请各位大虾帮帮手,C#运行时出现一个特怪异的问题!急待解决!!!
以下为程序中运行的部分代码,调用时会报‘操作成功完成’的错误信息。通过cordbg.exe调式会提示缺少msdis140.dll这个文件,单不论将.net 1.1重装还是将msdis140.dll拷进目录下依然会出错。
文章最后是获取的详细错误信息,请帮看看。谢谢!
bool bStartTf=false;
string currentFileName=AppDomain.CurrentDomain.BaseDirectory+"TEST.exe";
Process[] processes = null;
if(!System.IO.File.Exists(currentFileName))
{
MessageBox.Show("基目录下不存在TEST.exe,请检查!");
return;
}
try
{
processes = Process.GetProcessesByName("TEST");
}
catch(Exception ex)
{
MessageBox.Show(ex.Source,"GetProcessesByName");
}
foreach(Process process in processes)
{
if(process.MainModule.FileName == currentFileName)
{
bStartTf=true;
}
}
if(bStartTf==false)//程序未启动
{
try
{
WebRequest webrequese=WebRequest.Create("http://www.baidu.com/");
WebResponse webresponse = webrequese.GetResponse();
if(webrequese.ContentLength!=0)
{
Process.Start(currentFileName);
}
}
catch(Exception ex)
{
MessageBox.Show(ex.Message,"GetProcessesByName");
}
}
----------------------------------以上为代码部分-----------------------------------------------
详细异常信息:
-- 通过 cordbg.exe 调式出现如下错误:
Microsoft (R) Common Language Runtime Test Debugger Shell Version 1.1.4322.573
Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.
(cordbg) a 0xc34
Process 3124/0xc34 created.
Warning: couldn't load symbols for c:\windows\microsoft.net\framework\v1.1.4322\
mscorlib.dll
Warning: couldn't load symbols for D:\Start.exe
Warning: couldn't load symbols for c:\windows\assembly\gac\system\1.0.5000.0__b7
7a5c561934e089\system.dll
Warning: couldn't load symbols for c:\windows\assembly\gac\system.windows.forms\
1.0.5000.0__b77a5c561934e089\system.windows.forms.dll
Warning: couldn't load symbols for c:\windows\assembly\gac\system.drawing\1.0.50
00.0__b03f5f7f11d50a3a\system.drawing.dll
Warning: couldn't load symbols for c:\windows\assembly\gac\system.xml\1.0.5000.0
__b77a5c561934e089\system.xml.dll
Warning: couldn't load symbols for d:\date.dll
Warning: couldn't load symbols for c:\windows\assembly\gac\system.data\1.0.5000.
0__b77a5c561934e089\system.data.dll
Warning: couldn't load symbols for d:\Demo.dll
[thread 0x3bc] Thread created.
Unable to determine existence of prolog, if any
[thread 0x3ac] Thread created.
[thread 0xd4c] Thread created.
[thread 0xd38] Thread created.
[thread 0x3bc] Unhandled exception generated: (0x052986a0) <System.ComponentMode
l.Win32Exception>
nativeErrorCode=0x00000000
_className=<null>
_exceptionMethod=<null>
_exceptionMethodString=<null>
_message=(0x05298954) "操作成功完成。"
_innerException=<null>
_helpURL=<null>
_stackTrace=(0x05298974) array with dims=[48]
_stackTraceString=<null>
_remoteStackTraceString=<null>
_remoteStackIndex=0x00000000
_HResult=0x80004005
_source=<null>
_xptrs=0x00000000
_xcode=0xe0434f4d
[02ee] mov dword ptr [ebp-0Ch],0
(cordbg) Process exited.