简体   繁体   English

找不到或打开PDB文件,调试本机代码

[英]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属性设置为

C#项目调试属性

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.

相关问题 VS Code中的“无法找到或打开PDB文件” - “Cannot find or open the PDB file” in VS Code VS代码“无法找到或打开PDB文件”,即使pdb存在并且加载了其他csproj pdb文件 - VS Code “Cannot find or open the PDB file” even though the pdb exists and it loads other csproj pdb files 无法找到或打开PDB文件 - PDB不是用DLL构建的 - Cannot find or open the PDB file - PDB not built with DLL C# 远程调试器 - 无法找到或打开 PDB 文件 - C# Remote Debugger - Cannot find or open the PDB file “无法找到或打开另一个解决方案中找到的类库的PDB文件” - “Cannot find or open the PDB file” of a class library found in another solution Visual Studio 2013 RC 中的“无法找到或打开 PDB 文件” - “Cannot find or open the PDB file” from Visual Studio 2013 RC 为什么我的Visual Studio会以这种方式开始行动? iisexpress无法找到或打开PDB文件 - Why did my Visual Studio start acting this way? iisexpress cannot find or open the PDB file 在使用C#接口访问SWI-Prolog时找不到或打开PDB文件消息 - Cannot find or open the PDB file message in using of C# interface to SWI-Prolog 在 Visual Studio 中使用 Pdb 文件和源代码文件进行调试 - Debugging with Pdb file and Source Code File in Visual Studio 找不到pdb文件 - Unable to find pdb file
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM