简体   繁体   English

无法调试Excel加载项

[英]Cannot debug the Excel Addin

I have created a plugin project, where this is a plugin to MS Excel. 我创建了一个插件项目,这是MS Excel的插件。 I also has some C++ code written and it is written in VS 2008, and i am using 2010. And this causes on the Excel sheet open and i cant find the plugins visible in the debug mode. 我也写了一些C ++代码,它是用VS 2008编写的,并且我正在使用2010。这会导致Excel工作表打开,并且我找不到在调试模式下可见的插件。 But when i install the Setup i see all the features and plugin also visible. 但是,当我安装安装程序时,我也看到了所有功能和插件。

I some times get an error 我有时会出错

Debugging information for EXECEL.EXE could not be found or does not match. Cannot find or open the PDB file.

and also this 还有这个

Debugging information for EXECEL.EXE could not be found or does not match. Exports are loaded.

Please someone help me in this as i am new to this, doing from the scratch. 请有人帮助我,因为我是新手,请从头开始。

i am using VS2010 c# winforms 我正在使用VS2010 C#Winforms

The error message is saying that you don't have the PDBs (files that contain debugging information for an executable) for Excel.exe. 错误消息是说您没有Excel.exe的PDB(包含可执行文件调试信息的文件)。 This makes sense, since Microsoft does not publish them. 这是有道理的,因为Microsoft不会发布它们。

If you set breakpoints in your addin, they should work fine as you use Excel to run the code in your addin. 如果您在外接程序中设置了断点,则当您使用Excel在外接程序中运行代码时,它们应该可以正常工作。 Depending on how Excel addins work, they might not be loaded into the process until they are used, so even if Visual Studio says that it can't set the breakpoint initially because the DLL isn't loaded, that's ok - as soon as you do something in Excel that requires your addin, it should be loaded and then Visual Studio will set the breakpoint. 根据Excel加载项的工作方式,直到使用它们,它们才可能不会加载到流程中,因此即使Visual Studio表示由于未加载DLL最初不能设置断点,也可以-只要您在Excel中执行需要您的插件的操作,应将其加载,然后Visual Studio将设置断点。

When you attach to Excel, make sure to select managed debugging (.NET 4 in this case, based on the tags on your question). 当您附加到Excel时,请确保选择托管调试(在这种情况下,.NET 4是基于问题上的标记的)。 If you select automatic, Visual Studio will probably only enable unmanaged debugging which won't allow you to debug your C# addin. 如果选择自动,Visual Studio可能只会启用非托管调试,这将不允许您调试C#加载项。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM