我的工具:

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系统。


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


当前回答

我也遇到过类似的问题。在我的例子中,我的项目路径的长度对于窗口来说太长了(超过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工作正常。

其他回答

对我来说,我认为我的解决方案在更改本地Git回购的哪个分支时陷入了一种奇怪的状态。简单地切换到我在问题开始之前的上一个分支,告诉VS重新加载所有文件,然后切换回所需的分支并重新加载再次修复它。

根据我的情况,我尝试了上面所有的建议。 但是,在某种程度上,我意识到即使Resharper暂停,问题仍然存在。 所以,我在VS本身中寻找了类似的问题,并在这篇So帖子中接受答案的评论中找到了解决方案。

为了简洁起见,我列出了我的步骤。

VS -> Tools -> Options -> ReSharper Suspend按钮 构建解决方案。注意,所有引用仍未解决 清洗溶液 重新启动和 在没有Resharper的情况下构建解决方案。注意所有引用都已解析 VS -> Tools -> Options -> ReSharper Resume按钮

正如你所看到的,解决方案就是每个人都已经提到的——简单地暂停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)

缓存清理对我来说都没用。所有的符号在任何我们的私有NuGet repros只是停止拾取r#启用,非常令人沮丧。 在切换并重新启动VS2019后,我从JetBrains支持那里得到了以下反馈:

关闭以下选项- ReSharper | Options | Environment | General |直接读取解决方案模型

我在使用Visual Studio 2015和ReSharper Ultimate 10.0.2时就遇到了这种情况。在回答这个问题之前,我尝试了几乎所有的解决方案(除了重新安装),但都不起作用。

我让它再次以非常具体的顺序使用上述各种步骤:

ReSharper → Options → Environment → General → Clear Caches this must be done before suspending ReSharper as otherwise this option is unavailable this clears out the files in C:\Users\YourUsername\AppData\Local\JetBrains\Transient\ReSharperPlatformVs14\v04 as mentioned in some other posts Tools → Options → ReSharper Ultimate → Suspend Close Visual Studio this actually performs the ReSharper cache clear Open Visual Studio Open the solution I waited for Visual Studio to detect there were no code issues in IntelliSense and may have performed a build at this point. Tools → Options → ReSharper Ultimate → Resume

希望在最后一步之后,你可以松一口气,你不需要重新安装任何东西,我当然做了!