转到定义:“无法导航到插入符号下的符号." [英] Go To Definition: "Cannot navigate to the symbol under the caret."

查看:54
本文介绍了转到定义:“无法导航到插入符号下的符号."的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我今天突然开始在我的项目中遇到一个问题,点击转到定义给我一个奇怪的错误:无法导航到插入符号下的符号."

I suddenly started experiencing a problem today in my project where clicking Go To Definition gives me a strange error: "Cannot navigate to the symbol under the caret."

我在通过 NuGet 安装 Costura.Fody 一段时间后第一次注意到它.我已经卸载了它,但问题仍然存在.我已经多次清理和重建解决方案.在我的 git 提交历史记录中的任何地方都没有Fody"或Costura"的实例,在这种情况开始发生之前或之后,所以我认为我的一个 .gitignore 文件被卡在了一个错误中状态.

I first noticed it some time after installing Costura.Fody via NuGet. I've since uninstalled it but the problem persists. I've cleaned and rebuilt the solution multiple times. There are no instances of "Fody" or "Costura" anywhere in my git commit history, before or after the point in time when this started happening, so I'm thinking that one of my .gitignore'd files is stuck in a bad state.

仅当目标定义在另一个文件中时才会出现问题;转到当前打开文件中某些内容的定义工作正常.Peek Definition 也能正常工作.其他解决方案/项目也可以正常工作 - 只有这个解决方案会导致问题.

The problem only occurs if the definition being targeted is in another file; Go To Definition for something in the currently opened file works fine. Peek Definition works fine too. Other solutions/projects work fine as well -- it's only this one that's causing issues.

我使用的是 Visual Studio 2015.这个问题在 2013 版本中似乎没有发生.

I'm using Visual Studio 2015. The issue doesn't seem to occur in the 2013 version.

为什么会出现这个错误,我该如何解决?

Why does this error occur and how can I fix it?

推荐答案

最近几天我一直收到这个错误,每天至少两次......真的很烦人!这里提出的解决方案都没有对我有用.我发现,因为很难找到,所以我把它写在这里,是:

The last couple of days I've been getting this error, at least twice a day.. really annoying! None of the solutions proposed here has worked for me. What I found, and since it was pretty difficult to find I'm writing it down here, was to:

  • 关闭视觉
  • 打开控制台并导航到 Visual 安装文件夹,在我的电脑中是 C:Program Files (x86)Microsoft Visual Studio 14.0Common7IDE
  • 运行 devenv.exe/resetuserdata
  • 打开 Visual Studio,加载需要一些时间.

免责声明:我正在使用 Xamarin

Disclaimer: I'm using Xamarin

考虑@OzSolomon 和@xCasper 所说的话:

@OzSolomon

知道这将重置您的许多 IDE 自定义,包括已安装插件.

在使用之前请确保您对此感到满意/重置用户数据

Know that this will reset many of your IDE customization, including installed plugins.

Make sure you're comfortable with that before using /resetuserdata

@xCasper

但是,如果您通过 Microsoft 同步了您的设置,则大多数偏好似乎恢复了自己.我说最多是因为似乎我的键绑定没有恢复并恢复为默认值.其他一切,例如我选择的主题和颜色选择,我的 IDE 的布局(例如我有标签的地方),以及什么不是好像回来了.

If you have your settings synced through Microsoft, however, most of the preferences seem to restore themselves. I say most because it seems my keybindings did not restore and are back to being default. Everything else, such as my selected theme and colorization choices, the layout of my IDE (where I have tabs for instance), and what not seem to of come back.

这篇关于转到定义:“无法导航到插入符号下的符号."的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆