如何在Visual Studio 2008 Express C#中调试这种情况 [英] How to debug in Visual Studio 2008 express C# this scenario

查看:57
本文介绍了如何在Visual Studio 2008 Express C#中调试这种情况的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有加载插件的C#桌面应用程序.它加载插件的格式是这样的:插件及其配置文件被压缩到一个文件中,并且必须位于"Packages"目录中当托管应用程序加载时,它将zip解压缩到"Unpacked"目录中并加载插件.现在我想调试我创建的插件,但是如何?
我已经做了:

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>

,它工作正常,但不会加载我的插件.即使我将输出路径定义为"Packages"目录或"Unpacked"目录.
该怎么办?调试dll?

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?

更新:
如果我错了,我想是目前的我,但我需要专业版,也许需要使用Attache来处理功能.

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

推荐答案

有很多方法.一种方法是使用刹车点.但这并不总是一个好的选择.您还可以使用Visual Studio的窗口来监视程序中的内容(变量,对象变量等)如何变化(我不记得允许您执行此操作的窗口部分的名称),但这是一个有点难做.

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.

这篇关于如何在Visual Studio 2008 Express C#中调试这种情况的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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