使用库的官方二进制文件,而不会丢失按需加载源的选项

时间:2022-10-12 21:54:26

Within a Visual Studio (2005/2008) Project I'd like to use an open source library. I'd like to link to the binaries so that I'm not responsible for a proper build and can check those binaries into the source control server (SVN).

在Visual Studio(2005/2008)项目中,我想使用开源库。我想链接到二进制文件,以便我不负责正确的构建,并可以将这些二进制文件检入源控制服务器(SVN)。

So far so good, but if I'd like to debug into the open source library or want to take a look at a class implementation I would be forced to add the the source of the project into my solution and than link my project to the source instead of the binaries.

到目前为止一切都那么好,但如果我想调试开源库或者想看一下类实现,我将*将项目的源代码添加到我的解决方案中,而不是将我的项目链接到源而不是二进制文件。

Is it possible to tell Visual Studio a location of the source of a linked binary library so that things like "go to definition" and debug is working?

是否有可能告诉Visual Studio链接二进制库的源位置,以便“转到定义”和调试等工作?

2 个解决方案

#1


There are multiple ways you can achieve this.

有多种方法可以实现这一目标。

  1. Like gbjbaanb suggested you can use pdb symbols. It's going to work for both managed an unmanaged code.

    像gbjbaanb建议你可以使用pdb符号。它可以用于托管非托管代码。

  2. If you're using .NET you can debug with Reflector. Oran Dennison wrote how to debug with Reflector and Visual Studio. One of my favorite tools is TestDriven.NET. Author of this tool, Jamie Cansale, also blogged about how to debug with Reflector when you have TestDriven.NET. In his article, Jamie has a link to screencast where he demonstrates how to do it step by step.

    如果您使用的是.NET,则可以使用Reflector进行调试。 Oran Dennison写了如何使用Reflector和Visual Studio进行调试。我最喜欢的工具之一是TestDriven.NET。这个工具的作者Jamie Cansale也在博客上发表了关于如何在使用TestDriven.NET时使用Reflector进行调试的文章。在他的文章中,杰米有一个屏幕截图的链接,他在那里逐步演示如何做到这一点。

  3. Last, if you use for your SVN client like TortoiseSVN, you can add files/directories from check in. More details how to Ignore Files and Directories with TortoiseSVN.

    最后,如果您使用像TortoiseSVN这样的SVN客户端,则可以从签入时添加文件/目录。更多详细信息如何使用TortoiseSVN忽略文件和目录。

#2


Absolutely, if you have the pdb symbols its all done for you - look at MFC for example, you get the binaries yet can debug through the source.

当然,如果你有pdb符号全部为你完成 - 例如,看看MFC,你得到二进制文件,但可以通过源调试。

If you don't have the symbols, then its a lot more complicated, when you debug through the code it may ask you to show it the source lines, and you'll just have to find them for it (usually the path is the same so its easy).

如果你没有这些符号,那么它会更加复杂,当你通过代码进行调试时,它可能会要求你向它显示源代码行,你只需要为它找到它们(通常路径就是同样如此容易)。

#1


There are multiple ways you can achieve this.

有多种方法可以实现这一目标。

  1. Like gbjbaanb suggested you can use pdb symbols. It's going to work for both managed an unmanaged code.

    像gbjbaanb建议你可以使用pdb符号。它可以用于托管非托管代码。

  2. If you're using .NET you can debug with Reflector. Oran Dennison wrote how to debug with Reflector and Visual Studio. One of my favorite tools is TestDriven.NET. Author of this tool, Jamie Cansale, also blogged about how to debug with Reflector when you have TestDriven.NET. In his article, Jamie has a link to screencast where he demonstrates how to do it step by step.

    如果您使用的是.NET,则可以使用Reflector进行调试。 Oran Dennison写了如何使用Reflector和Visual Studio进行调试。我最喜欢的工具之一是TestDriven.NET。这个工具的作者Jamie Cansale也在博客上发表了关于如何在使用TestDriven.NET时使用Reflector进行调试的文章。在他的文章中,杰米有一个屏幕截图的链接,他在那里逐步演示如何做到这一点。

  3. Last, if you use for your SVN client like TortoiseSVN, you can add files/directories from check in. More details how to Ignore Files and Directories with TortoiseSVN.

    最后,如果您使用像TortoiseSVN这样的SVN客户端,则可以从签入时添加文件/目录。更多详细信息如何使用TortoiseSVN忽略文件和目录。

#2


Absolutely, if you have the pdb symbols its all done for you - look at MFC for example, you get the binaries yet can debug through the source.

当然,如果你有pdb符号全部为你完成 - 例如,看看MFC,你得到二进制文件,但可以通过源调试。

If you don't have the symbols, then its a lot more complicated, when you debug through the code it may ask you to show it the source lines, and you'll just have to find them for it (usually the path is the same so its easy).

如果你没有这些符号,那么它会更加复杂,当你通过代码进行调试时,它可能会要求你向它显示源代码行,你只需要为它找到它们(通常路径就是同样如此容易)。