简体   繁体   English

为什么有时视觉工作室会丢失课程参考?

[英]Why does sometimes, the visual studio loses a class reference?

Sometimes, the reference of a method that it's on a static class, just disappeared. 有时,对方法在静态类上的引用就消失了。 That means that it's not painted in the "green" color that's typical of a class, and i can't neither navigate trough this method(right click > go to definition) 这意味着它不会以类的典型“绿色”颜色进行绘制,而且我也无法通过该方法进行导航(右键单击>转到定义)

Why is this happening? 为什么会这样呢?

thx. 谢谢。

You probably have something else closer to your scope (like a property) that has the same name. 您可能还有其他更接近您的范围的名称(例如属性)。
The code editor won't go too much out of its way to guess whether the identifier is a type or a property. 代码编辑器不会过多地猜测标识符是类型还是属性。

This usually happens if you open the file directly without opening the project. 如果直接打开文件而不打开项目,通常会发生这种情况。 I have seen this happening when visual studio loads the source code for a class while debugging(single stepping through the code) for which the project is not loaded. 我已经看到了这种情况,当Visual Studio在调试(未单步执行代码)未加载项目的调试时为一个类加载源代码时。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 尝试构建时,Visual Studio丢失了引用 - Visual Studio loses reference when attempting to build 为什么Visual Studio有时不会进入我的断点? - Why does Visual Studio sometimes not go to my breakpoints? "Visual Studio 失去了附加到 Unity 的能力,为什么?" - Visual Studio loses ability to attach to Unity, why? 为什么Visual Studio 2010会在我的类库中添加“self to reference”? - Why does Visual Studio 2010 keep adding a “reference to self” in my class library? Unity:Visual Studio 在 Unity 编译代码后丢失 DLL 引用 - Unity: Visual Studio loses DLL reference after Unity compiles code 为什么Visual Studio会添加不同版本的引用? - Why does Visual Studio add reference with different version? 为什么Visual Studio可以检测到需要哪个“使用”,然后又说不存在导致添加引用的类型或类呢? - Why can Visual Studio detect which “using” is needed, but then say the type or class which provoked the addition of the reference does not exist? 为什么Visual Studio IDE有时会初始化“this.components对象:有时候不会? - Why does the Visual Studio IDE sometimes initialize the "this.components object: and other times not? 是否可以在Visual Studio / C#中构建,重新构建其依赖项? 为什么有时需要使用清洁剂? - Does build in visual studio/c# , rebuild it's dependencies? Why do I need to use clean sometimes? Visual Studio 在类库中找不到引用 - Visual Studio not finding reference in Class Library
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM