如何在Visual Studio中将源附加到引用的程序集

编程入门 行业动态 更新时间:2024-10-28 12:26:48
本文介绍了如何在Visual Studio中将源附加到引用的程序集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我非常新的Visual Studio,来自Java开发Eclipse。除了别的以外,我非常想念Eclipse是能够查看二进制程序集的源代码。

在Eclipse中,我可以引用引用的jar的源代码,之后死了很容易导航到源,添加断点和调试那些,就像我在我的工作区中有这些库。

到目前为止,我还没有设法附加源代码到程序集引用。

可以吗?我该怎么做(考虑到我有权访问这个库的源代码)?

解决方案

使用VS2010 - 您将首先需要使用调试符号编译引用的程序集。

然后有几个选项:

  • 在对象浏览器中查找要调试的对象。右键单击 - >从符号文件导航到 - >源。
  • 逐步浏览代码,直到您进入引用的程序集。此时会弹出一个对话框,询问源文件的位置。如果没有,或者您取消了它,则右侧将显示浏览到查找源。如果这是灰色的,那可能是因为您引用了一个发行版本。
  • I am fairly new to Visual Studio, coming from Java development on Eclipse. Among other things I sorely miss from Eclipse is an ability to view source of binary assemblies.

    In Eclipse I can attach reference to source code for a referenced jar and after that it is dead easy to navigate to the source, add breakpoints and debug those as though I have the libraries in my workspace.

    Up to this point I have not managed to attach source code to an assembly reference.

    Is it possible? How do I go about doing that (given that I do have access to the source code for this library)?

    解决方案

    Using VS2010 - you will first need to compile your referenced assemblies with debug symbols.

    A couple of options are then:

  • Find an object which you want to debug in Object Browser. Right click -> Navigate To -> Sources From Symbol Files.
  • Step through your code until you step into the referenced assembly. At this point a dialog will pop up asking where the source files are. If it doesn't, or you cancelled it, then a "Browse to Find Source" will appear on the right. If this is greyed out, then that may be because you are referencing a release assembly.
  • 更多推荐

    如何在Visual Studio中将源附加到引用的程序集

    本文发布于:2023-11-11 21:36:06,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1579616.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:中将   程序   如何在   Studio   Visual

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!