[英]cannot find or open PDB file, debugging native code
I have a code running that successfully register Excel AddIn using C# Automation and talks to C++ though C# layer 我运行的代码可以使用C#Automation成功注册Excel加载项,并通过C#层与C ++对话
// Tools -> Create GUID -> Register Format
namespace MyExcelAddins
{
[ClassInterface(ClassInterfaceType.AutoDual), ComVisible(true)]
[Guid("6F89542F-3DAC-471F-86DD-145F5E456968")]
public class MyExcelFunctions : AddInRegistrator
{
[DllImport(@"C:\Users\Ilya\Documents\Visual Studio 2012\Projects\UnmanegedTester\x64\Debug\")]
public static extern double AddNumbers(double a, double b);
public double SampleAdd(double a, double b)
{
double res = AddNumbers(a, b);
return res;
}
}
}
Here is the view of my solution where C++ project I added from another directory. 这是我的解决方案的视图,我从另一个目录添加了C ++项目。
I was able to debug C# code and now I want to try to debug the C++ part. 我能够调试C#代码,现在我想尝试调试C ++部分。 I set the debug property of C# project to
我将C#项目的debug属性设置为
and when click run, the error I got is 当单击运行时,我得到的错误是
If I uncheck "Enable Native Code Debugging", I do not have the error but of course cannot debug C++. 如果我取消选中“启用本机代码调试”,则不会出现错误,但是当然不能调试C ++。 My guess I'm missing something in the settings.
我猜我在设置中缺少某些内容。 Please let me know if anyone has an idea how to fix that.
如果有人有解决办法,请告诉我。
If I continue debugging I can hit breakpoint in C# but not in C++ 如果继续调试,我可以在C#中命中断点,但在C ++中不能命中
That error message is telling you that you don't have debug symbols for excel.exe
, which is not surprising since it is a Microsoft program. 该错误消息告诉您您没有
excel.exe
调试符号,这并不奇怪,因为它是一个Microsoft程序。 You can continue debugging, and your code (which should have debugging information) will still be debuggable. 您可以继续调试,并且您的代码(应该具有调试信息)仍然可以调试。 For example, you can set a breakpoint in some of your code that will be called by Excel and the debugger will stop on it when it is reached.
例如,您可以在将要由Excel调用的某些代码中设置一个断点,并且调试器将在到达断点时停止在该断点上。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.