我的工具:

Visual Studio 2012终极+更新

ReSharper v7.1.25.234

我的解决方案构建状态:成功构建

但是当我安装ReSharper和ReSharper代码分析是启用的,我的代码的许多关键字是红色的这个错误:

"无法解析符号XXX"


我的项目>>的另一张照片

ReSharper“不能解决符号”错误到处都是,但我的项目构建过程是成功的,它工作正确。

附加说明:如果我禁用ReSharper代码分析,我的项目将是正常的,但我想使用ReSharper代码分析。


我尝试了ReSharper→Options→General→Clear Cache。但我还是有这个问题!


一个月前,当我卸载Visual Studio 2012 RC并安装VS 2012 RTM时,我得到了这些错误。 我已经卸载并重新安装了ReSharper。但我还有这个问题! 我的解决方案有五个项目>>两个加载项目(主项目+资源项目)和三个卸载项目


我意识到我的Visual Studio也有更大的问题(更多关于堆栈溢出的信息)

我不能添加任何引用到我的项目(甚至在新的解决方案和新项目中) 我不能安装任何包(通过“包管理器控制台”或管理NuGet包) 我不能更新任何包(通过“包管理器控制台”或管理NuGet包)

我(对自己和他人)提出了很多建议

重新抵抗一些DLL文件 使用一些窗口和注册表修复工具 删除ReSharper 修复Visual Studio 和…

但我解不出来。

我在考虑安装一个新的Windows系统。


出了什么问题,我该如何解决?


当前回答

对我来说,检查解决方案给了我数百个错误,包括许多“无法在搜索路径中找到文件”。我试过了所有的方法都没用。我最终发现,检查项目,而不是解决方案,工作得很完美。

其他回答

这应该是一个与Resharper缓存相关的问题,但据我所知,“清除缓存”功能只在你的缓存在解决方案文件夹中才有效。 要检查,试试这个: Visual Studio >工具>选项> Resharper >选项…

在Resharper Options窗口> Environment > General 检查“存储解决方案缓存”设置为“解决方案文件夹”

在解决方案文件夹中,你应该看到一个新文件夹“_ReSharper.Caches”。你应该可以通过按“清除缓存”按钮来清理它,但是(如果这不起作用)你可以通过删除内部文件来手动清理(在这种情况下,Visual Studio已经关闭了)。

重新启动Visual Studio,一切都应该工作。 看看这里[1]

[1] https://resharper-support.jetbrains.com/hc/en-us/articles/206546989-ReSharper-stopped-working-for-a-single-specific-solu tion

注意:Visual Studio 2015 Update 1 / ReSharper 10.0.2

我最终需要请求Resharper清除它的缓存,并通过Windows文件资源管理器手动完成。这最终解决了我的问题。

(正如在这里的许多解决方案中报告的那样)RESHARPER >选项…>环境>常规>清除缓存。 关闭Visual Studio。 在Visual Studio 2015 Resharper 10的文件资源管理器中转到以下路径:%localappdata%\JetBrains\Transient\ReSharperPlatformVs14 删除该文件夹内的所有子文件夹及其内容。 重新启动Visual Studio,重新加载解决方案,并等待Resharper为解决方案初始化自己。

我也遇到过类似的问题。在我的例子中,我的项目路径的长度对于窗口来说太长了(超过248个字符)。

我的解决方案在VS 2017编译好了,但ReSharper找不到参考。有趣的是,即使构建成功,我在错误窗口中也有一个错误:

Severity Code Description Project File Line Suppression State Error MSB3491 Could not write lines to file "obj\Debug\netcoreapp2.1\My.Long.Path.Project.Name.csproj.CoreCompileInputs.cache". The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters. My.Long.Path.Project.Name C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets 3430

所以我缩短了项目路径,ReSharper工作正常。

我有同样的问题,卸载和重新加载有问题的项目帮助我清除了ReSharper这个问题。希望这能有所帮助。

正如你所看到的,解决方案就是每个人都已经提到的——简单地暂停ReSharper,然后清理缓存,最后恢复它。但是,没有人提到如何在不关闭/重新启动Visual Studio的情况下做到这一点。

只需遵循以下步骤:

Getting ReSharper Cache Location Manually by going to ReSharper Options > Environment > General > Store Solution Caches in (Combo Box) (marked 2 in the image). Selecting Custom Folder, then Copying the location of the Caches Folder from the text box shown (marked 3 in the image). Reverting the settings back. The 1 marked shows the ClearCache Button. It's usually wouldn't work so leave it. Suspending ReSharper You can do this by going to Tools > Options > ReSharper Or ReSharper Ultimate > Suspend Now (Button) Clearing the Cache Go to the location copied earlier in step 1 and delete everything in that folder. And yes, I do mean everything. Resuming ReSharper You can do this by again going to Tools > Options > ReSharper Or ReSharper Ultimate > Resume (Button)