简体   繁体   中英

Go to metadata with VB.net on F12 in visual studio

When developing with C# you can right click a class and click go to definition. If the class is 3rd party code (microsoft, or other dll reference) the classes metadata comes up. (alternatively you can hit F12).

In VB.NET the useless Object Browser Windows comes up. Is there anyway to make this behave like C#? I just want the Metadata to come up. The object browser does not allow you to do a free text search the same way as you can with a plain text file (metadata).


For example the C# Metadata looks like this (using IEnumerable):

#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();
    }
}

While in VB.Net the F12 key will bring up the Object Browser:

对象浏览器

If the 3rd party code is written in C# and your code is written in vb.net, VS is not able to show you the definition. This is a bug reported multiple times - It seems that the "Metadata"-function or "Go to definition"-function only works in pure-C# or pure-VB.NET projects

see this post

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM