在使用C#进行开发时,您可以右键单击一个类,然后单击“转到定义”。如果类是第三方代码(microsoft或其他dll引用),则会出现类元数据。(也可以点击F12)。
在VB.NET中,出现了无用的对象浏览器Windows。不管怎么说,这样的行为会像C#一样吗?我只想让元数据出现。对象浏览器不允许您使用纯文本文件(元数据)进行免费文本搜索。
例如,C#元数据如下(使用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键将打开对象浏览器:

发布于 2014-09-14 09:04:30
如果第三方代码是用C#编写的,而您的代码是用vb.net编写的,VS无法向您显示定义。这是一个多次报告的bug -似乎“元数据”-function或“转到定义”-function只在纯C#或纯VB.NET项目中工作。
见这篇文章
https://stackoverflow.com/questions/25793418
复制相似问题