Windows C#应用程序中的错误没有响应... [英] Error in Windows C# Application doesnt respond ...
问题描述
朋友们...
我已经开发了一个C#应用程序,该应用程序使用反射从DLl''S中读取方法信息.对于小型应用程序Dll's来说,它可以正常工作(即10至15个Dll,每个由10-15个方法组成)
但是,当我给出一个包含20-30个Dll的应用程序,而所有Dll的方法总数大约为3000时,该应用程序没有响应,并在输出窗口中将消息显示为
线程``< No Name>''(0x418)已退出,代码为0(0x0).
但是当我在任务管理器中查看它时,它占用了大约50%的CPU使用率...
请帮我....
我什至无法找到我的应用程序是否正在运行.
Hi Friends...
I have developed a C# Application which read the the method info from DLl''S using Reflection .For small Application Dll''s it working fine (i.e10 to 15 Dlls Consisting of 10-15 methods each)
But when i give an application which consists of 20-30 Dlls and the total method count from all Dlls around 3000) the application doesnt respond and shows the message in the output window as
The thread ''<No Name>'' (0x418) has exited with code 0 (0x0).
but when i look it in the taskmanager it takes around 50% of the CPU usage...
Pls help me out....
i could nt even find wether my application is runnning or not.
推荐答案
在代码中放置try/catch
块并使用调试器.这是随Visual Studio一起安装的免费工具.
Put try/catch
blocks around your code and use the debugger. It''s a free utility that is installed with Visual Studio.
您是否为每个DLL触发了一个线程?如果是这样,请使用线程池并管理并发运行的线程数,以使应用程序保持运行状态.
这个站点上有很多关于线程池的文章,我写了其中一篇.
多线程,委托和自定义事件 [
Are you firing off one thread per DLL? If so, use a thread pool and manage the number of concurrently running threads to allow the application to keep up.
There are a number of articles on this site regarding thread pooling, and I wriote one of them.
Multithreading, Delegates, and Custom Events[^]
Your original question provides NO info regarding what you''ve tried, or how you''re doing it. Until you provide that info, the best you''re going to get is a stab in the dark, and most likely, no real answer at all.
这篇关于Windows C#应用程序中的错误没有响应...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!