在visual studio中的F12上使用VB.net转到元数据

在visual studio中的F12上使用VB.net转到元数据,vb.net,visual-studio-2010,visual-studio-2012,Vb.net,Visual Studio 2010,Visual Studio 2012,使用C#开发时,您可以右键单击一个类,然后单击“转到定义”。如果类是第三方代码(microsoft或其他dll引用),则会显示类元数据。(或者您可以点击F12) 在VB.NET中,会出现无用的对象浏览器窗口。有没有办法让它表现得像C#?我只是想把元数据拿出来。对象浏览器不允许以与纯文本文件(元数据)相同的方式执行自由文本搜索 例如,C#元数据如下所示(使用IEnumerable): #区域程序集mscorlib.dll,v4.0.0.0 //C:\Program Files(x86)\Refe

使用C#开发时,您可以右键单击一个类,然后单击“转到定义”。如果类是第三方代码(microsoft或其他dll引用),则会显示类元数据。(或者您可以点击F12)

在VB.NET中,会出现无用的对象浏览器窗口。有没有办法让它表现得像C#?我只是想把元数据拿出来。对象浏览器不允许以与纯文本文件(元数据)相同的方式执行自由文本搜索


例如,C#元数据如下所示(使用IEnumerable):

#区域程序集mscorlib.dll,v4.0.0.0
//C:\Program Files(x86)\Reference Assembly\Microsoft\Framework\.NETFramework\v4.0\mscorlib.dll
#端区
使用系统集合;
命名空间System.Collections.Generic
{
//总结:
//公开枚举数,该枚举数支持对集合进行简单迭代
//属于特定类型的。
//
//类型参数:
//T:
//要枚举的对象的类型。此类型参数是协变的。即,
//您可以使用指定的类型,也可以使用派生得更多的任何类型。
//有关协方差和逆变换的详细信息,请参见协方差
//和仿制药中的逆变。
公共接口IEnumerable:IEnumerable
{
//总结:
//返回遍历集合的枚举数。
//
//返回:
//一个System.Collections.Generic.IEnumerator,可用于遍历
//收藏。
IEnumerator GetEnumerator();
}
}
在VB.Net中,F12键将打开对象浏览器:


如果第三方代码是用C#编写的,而您的代码是用vb.net编写的,则VS无法向您显示定义。这是一个多次报告的错误-似乎“元数据”函数或“转到定义”函数只在pure-C#或pure-VB.NET项目中有效

#region Assembly mscorlib.dll, v4.0.0.0
// C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\mscorlib.dll
#endregion

using System.Collections;

namespace System.Collections.Generic
{
    // Summary:
    //     Exposes the enumerator, which supports a simple iteration over a collection
    //     of a specified type.
    //
    // Type parameters:
    //   T:
    //     The type of objects to enumerate.This type parameter is covariant. That is,
    //     you can use either the type you specified or any type that is more derived.
    //     For more information about covariance and contravariance, see Covariance
    //     and Contravariance in Generics.
    public interface IEnumerable<out T> : IEnumerable
    {
        // Summary:
        //     Returns an enumerator that iterates through the collection.
        //
        // Returns:
        //     A System.Collections.Generic.IEnumerator<T> that can be used to iterate through
        //     the collection.
        IEnumerator<T> GetEnumerator();
    }
}