在Visual Studio中查找引用 [英] Finding references in Visual Studio

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

问题描述

我使用Visual Studio和COM使用C#首次有件事情我不太了解关于引用。你怎么知道如何与给定的使用something.something引用?在.NET引用看起来相当简单,但COM是那么明显。我在运行Visual Studio 2005,并安装了最新的VSTO,但对我的生活,我想不出什么,我需要引用满足:

I'm using Visual Studio and COM with C# for the first time and there's something I don't quite understand about the 'references'. How do you know what to reference with a given 'using something.something'? The .Net references seem fairly simple, but COM is less obvious. I'm running Visual Studio 2005 and have the latest VSTO installed, but for the life of me, I can't figure out what I need to reference to satisfy:

使用Microsoft.VisualStudio.Tools.Applications.Runtime;

using Microsoft.VisualStudio.Tools.Applications.Runtime;

有在.NET选项卡几Microsoft.VisualStudio的事情,但没有与.Tools或其它东西一样继续它。我觉得我在这里缺少一个关键的概念

There are a few Microsoft.VisualStudio things in the .Net tab, but none that continue with .Tools or anything like it. I feel like I'm missing a key concept here.

推荐答案

这里有两个问题 -

There are two issues here -

首先,将参考不一定对应于命名空间。单个参考可以包含多个名称空间,和一个命名空间可以由需要被引用的多个程序集共享。孤男寡女包括一个参考,您可以使用特定类型的,而不是整个命名空间。

First, a reference doesn't necessarily correspond to a namespace. A single reference can contain multiple namespaces, and a single namespace can be shared by multiple assemblies which would need to be referenced. Needing to include a reference allows you to use specific types, not entire namespaces.

二,这是后话,你需要事先知道。如果你正在使用微软的类,如您列出的命名空间中的人,MSDN可以是一个很大的帮助。

Second, this is something you'll need to know in advance. If you're using Microsoft's classes, such as the ones in the namespace you listed, MSDN can be a great help.

例如,拿的 Microsoft.VisualStudio.Tools.Applications.Runtime .ServerDocument

如果你看一下MSDN页面这个类(在该命名空间),靠近顶端,它包括:

If you look at the MSDN page for this class (in that namespace), near the top it includes:

命名空间:Microsoft.VisualStudio.Tools.Applications.Runtime

Namespace: Microsoft.VisualStudio.Tools.Applications.Runtime

大会:Microsoft.VisualStudio.Tools.Applications .Runtime(在microsoft.visualstudio.tools.applications.runtime.dll)

Assembly: Microsoft.VisualStudio.Tools.Applications.Runtime (in microsoft.visualstudio.tools.applications.runtime.dll)

这明确告诉你哪些组件​​是必需的。

This specifically tells you which assembly is required.

这篇关于在Visual Studio中查找引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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