簡體   English   中英

在Visual Studio中使用F12上的VB.net轉到元數據

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

使用C#進行開發時,您可以右鍵單擊一個類,然后單擊轉到定義。 如果該類是第三方代碼(微軟或其他dll引用),則會出現類元數據。 (或者你可以按F12)。

在VB.NET中出現了無用的對象瀏覽器Windows。 反正有沒有讓它像C#一樣? 我只想要元數據出現。 對象瀏覽器不允許您以與純文本文件(元數據)相同的方式執行自由文本搜索。


例如,C#Metadata看起來像這樣(使用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();
    }
}

在VB.Net中,F12鍵將打開對象瀏覽器:

對象瀏覽器

如果第三方代碼是用C#編寫的,而您的代碼是用vb.net編寫的,則VS無法向您顯示定義。 這是多次報告的錯誤 - 似乎“元數據”功能或“轉到定義”功能僅適用於純C#或純-VB.NET項目

看這篇文章

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM