如何在 Visual Studio 中将源附加到引用的程序集 [英] How to attach sources to referenced assembly in Visual Studio

查看:21
本文介绍了如何在 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.

那么有几个选项:

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

这篇关于如何在 Visual Studio 中将源附加到引用的程序集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆