How to debug in Visual Studio 2008 express C# this scenario

你。 提交于 2019-12-12 01:48:01

问题


I have C# desktop application that loads plugins. the format it loads the plugins is like this: the plugin and its configuration files are ziped in one file and have to be in "Packages" dir when the hosting application loads it extract the zip into the "Unpacked" dir and loades the plug in. now I like to debug the plugin I created but how?
I already did the:

<StartAction>Program</StartAction>
<StartProgram>C:\Program Files\app\MyAppStudio.exe</StartProgram>

and it's working fine , but it doesn't load my plugin . even if i define the output path to be the "Packages" dir or the "Unpacked" dir .
what to do? to debug the dll?

UPDATE:
I think current me if I wrong but I need the pro version and maybe to use attache to process function.


回答1:


There are many ways. One of the ways is to use brakepoints. But this is not always a good choice. You can also use Visual Studio's window to monitor how are things (variables, object variables, e.t.c.) changing in the program (I can't remember the name of the part of the window that allows you to do that), but this is a bit hard to do.

One of the ways that I use is adding functions that bring out variables or messages when something has been done, is being done or it hasn't been done or functions that pause the process. Or debugging by hand. It's simple to understand, but it takes some time to write.

For example: I don't know is a function starts when it has to start. I add a line that brings out the message "I have started working". If such message appears, means that the function is getting activated. I'm not sure if a variable is being calculated correctly. I add a line that brings out the new and old values of the variables. Or if I want to have some time to think about the current results, I just pause the program after I receive the current values. And so on, and so on... This should also works on other languages.

This method is really handy. I use it when the compiler's debugging features can't help me. It takes some time to add the code for debugging, but it's worth it. There is nothing more efficient that doing something by hand.



来源:https://stackoverflow.com/questions/7922898/how-to-debug-in-visual-studio-2008-express-c-sharp-this-scenario

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!