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

编程入门 行业动态 更新时间:2024-10-28 14:35:32
本文介绍了如何在 Visual Studio 中将源附加到引用的程序集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我是 Visual Studio 的新手,来自 Eclipse 上的 Java 开发.我非常怀念 Eclipse 的其他功能之一是查看二进制程序集源代码的能力.

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.

在 Eclipse 中,我可以为引用的 jar 附加对源代码的引用,之后导航到源代码、添加断点和调试它们就变得非常容易,就好像我的工作区中有库一样.

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)?

推荐答案

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

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

那么有几个选项:

  • 在对象浏览器中查找要调试的对象.右键单击 -> 导航至 -> 来自符号文件的源.
  • 单步执行您的代码,直到您单步执行引用的程序集.此时会弹出一个对话框,询问源文件在哪里.如果没有,或者您取消了它,那么右侧将出现浏览以查找源".如果它显示为灰色,则可能是因为您引用的是发布程序集.
  • 更多推荐

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

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

    发布评论

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

    >www.elefans.com

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