如何调试由 vb6/vba 应用程序调用的 vs 2008 c# express dll?
我有 ac# dll,它被编写为充当包装器,从数据源获取数据并将其传递给 vba/powerpoint ppa 应用程序。我对 vba 没有太多经验,这就是为什么我使用 vb6 来模拟这个,我对 vb6 稍微了解一点。
我现在遇到了足够多的问题,试图理解 com 和 ccw 的语法以及复杂的工作原理。所以我正在寻找一种方法来调试为什么该函数没有返回任何数据,并且如果可能的话,当 vb6 应用程序调用它时,对 .net dll 进行逐行演练。
最初我想在 .net dll 中放入一个函数,该函数将写入外部文件,但这似乎不起作用,我不知道为什么。
我做了一些谷歌搜索并发现有一个附件处理这可能对我的情况有用,但该功能是 仅在 vs studio 完整版中可用n。
所以我希望有其他工具、方法可以让我正确调试 vb6/vba 应用程序和 .net dll 之间发生的情况。
谢谢。
i have a c# dll which is written to act as a wrapper to grab data from a data source and pass it to a vba/powerpoint ppa application. i don't have much experience with vba which is why i'm simulating this using vb6 which i know a tiny bit more about.
i'm having enough problem as of now trying to understand the syntax and what not for the intricate workings of com and ccw. so i'm looking for a way to debug on why the function isn't returning me any data, and if possible have a line by line walkthrough of the .net dll when the vb6 app is calling it.
initially i thought of putting in a function inside the .net dll which will write out to an external file but that doesn't seems to be working and i don't know why.
i did some googling and found out that there's a attach to process which could be useful for my case but that feature is only available in vs studio full version.
so i'm hoping there's other tools, methods that i can use which can allows me to properly debug what's going on between the vb6/vba app and the .net dll.
thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
不幸的是,附加到进程对您来说不可用,因为这是要走的路。
在 .net dll 中放置适当的
Debug.Assert(false);
是强制显示调试器的一种方法。您还可以尝试 Debugger.Break(); ,它会强制设置断点并询问您是否要附加调试器。
Debug
和Debugger
都位于System.Diagnostics
命名空间中。Too bad attach to process isn't available to you because that is the way to go.
A well placed
Debug.Assert(false);
in the .net dll is one way to force a debugger to show up.You could also try
Debugger.Break();
which should force a breakpoint and ask you if you want to attach a debugger.Both
Debug
andDebugger
are in theSystem.Diagnostics
namespace.当您运行 C# 项目(“调试”->“开始调试”或 F5)时,它将启动 VB6。您可以在 C# 项目中放置任何您想要的断点。当您启动 VB6 项目时,调试器将停止在 VS2005/ 处。 2008 断点。您还可以使用调试 C# 项目时的即时窗口和任何其他调试选项。
When you run your C# project (Debug->Start Debugging or F5), it will start VB6. You can put any breakpoints you want in your C# project. When you start up your VB6 project, the debugger will stop at your VS2005/2008 breakpoint. You'll also be able to use the immediate window and any other debugging options that you would when debugging a C# project.
将其添加
到我的 C# Express 2008 项目的 .csproj 文件中的 PropertyGroup 元素下,对我来说就成功了
(详细信息)。
Adding this
to my C# Express 2008 project's .csproj file, under the PropertyGroup element, did the trick for me
(details here).
在 Visual C# Express Edition 之上下载并安装 Visual C++ Express Edition。两者都是完全免费的,这将使您能够在调试器中“附加到进程”
Download and install Visual C++ Express Edition on top of Visual C# Express Edition. Both are completely free, and that will give you the ability to "attach to process" in the debugger