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

查看:178
本文介绍了如何在Visual Studio中将源附加到引用的程序集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我非常新的Visual Studio,来自Java开发Eclipse。除了别的以外,我非常想念Eclipse是能够查看二进制程序集的源代码。



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



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



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

解决方案

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



然后有几个选项:


  1. 在对象浏览器中查找要调试的对象。右键单击 - >从符号文件导航到 - >源。

  2. 逐步浏览代码,直到您进入引用的程序集。此时会弹出一个对话框,询问源文件的位置。如果没有,或者您取消了它,则右侧将显示浏览到查找源。如果这是灰色的,那可能是因为您引用了一个发行版本。


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:

  1. Find an object which you want to debug in Object Browser. Right click -> Navigate To -> Sources From Symbol Files.
  2. 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中将源附加到引用的程序集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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