本文翻译自:ReSharper “Cannot resolve symbol” even when project builds

My Tools: 我的工具:

Visual Studio 2012 Ultimate + Update 1 Visual Studio 2012旗舰版+更新1

ReSharper v7.1.25.234 ReSharper v7.1.25.234

My Solution Build Status: Build Successfully 我的解决方案构建状态: 成功构建

But when I install ReSharper and ReSharper code analysis is enable, many keywords of my code are red with this error: 但是,当我安装ReSharper并启用ReSharper代码分析时,我的代码中的许多关键字都是红色的,并显示以下错误:

"Cannot resolve symbol XXX" “无法解析符号XXX”


Another picture of my project >> 我的项目的另一张图片>>

The ReSharper “CANNOT RESOLVE SYMBOL” errors are everywhere, but my project build process is successfully, and it works correctly. ReSharper“无法解析符号”错误无处不在,但是我的项目构建过程成功完成,并且可以正常工作。

Additional Note: If I disable ReSharper Code Analysis, my project will be Normal, but I want to use ReSharper code analysis. 附加说明:如果禁用ReSharper代码分析,则我的项目将为“正常”,但我想使用ReSharper代码分析。


I tried ReSharper → OptionsGeneralClear Cache . 我尝试了 ReSharper→ 选项常规清除缓存 But I still have this problem! 但是我仍然有这个问题!


  • One month ago, I got these errors when I uninstalled Visual Studio 2012 RC and installed VS 2012 RTM. 一个月前,当我卸载Visual Studio 2012 RC并安装VS 2012 RTM时遇到了这些错误。

  • I've already uninstalled and installed ReSharper again. 我已经卸载并重新安装了ReSharper。 But I have this problem yet! 但是我有这个问题了!

  • My solution has five projects >> two loaded projects (main project + resource project) and three unloaded projects 我的解决方案有五个项目>>两个已加载项目(主项目+资源项目)和三个已卸载项目


I realize that my Visual Studio also has bigger problems (More information on Stack Overflow) 我意识到我的Visual Studio还存在更大的问题 (有关堆栈溢出的更多信息)

  • I can't add any reference to my projects (even inside new solutions and new projects) 我无法对我的项目添加任何参考(即使在新解决方案和新项目中)

  • I can't install any package (by "Packet Manager Console" or Manage NuGet Package) 我无法安装任何软件包(通过“ Packet Manager控制台”或“管理NuGet软件包”)

  • I can't update any package (by "Packet Manager Console" or Manage NuGet Package) 我无法更新任何软件包(通过“ Packet Manager控制台”或“管理NuGet软件包”)

I've done a lot of suggestions (of myself and others) 我已经(对我自己和其他人)提出了很多建议

  • Re-resister some DLL files 重新重置一些DLL文件

  • Using some windows and registry repair tools 使用一些Windows和注册表修复工具

  • Remove ReSharper 删除ReSharper

  • Repair Visual Studio 修复Visual Studio

  • and... 和...

But I could not solve it. 但是我无法解决。

I'm thinking of installing a new Windows :( 我正在考虑安装新的Windows :(


What is wrong, and how can I fix it? 有什么问题,我该如何解决?


#1楼

参考:https://stackoom.com/question/13viB/ReSharper-无法解析符号-即使在项目构建时


#2楼

This happens in ReSharper when you have two different versions of the same library in your solution. 当您的解决方案中有相同库的两个不同版本时,在ReSharper中会发生这种情况。 For example project A references automapper version 1.1 and project B references automapper version 1.0. 例如,项目A引用了自动映射器版本1.1,而项目B引用了自动映射器版本1.0。

Visual Studio will often compile and run as expected in the situation as it chooses one of the DLLs to bind to. 由于选择了要绑定的DLL之一,Visual Studio通常会在这种情况下按预期进行编译和运行。 However ReSharper gets massively confused. 但是,ReSharper引起了极大的困惑。 For me this should be a ReSharper error that it asks you to resolve rather than just going bonkers. 对我来说,这应该是一个ReSharper错误,它要求您解决而不是仅仅胡闹。

UPDATE: 更新:

I ran into this two days ago (a day after I made this post) by total coincidence and came across this link where they say that it is caused by a bug in the VS API. 我是在两天前(写这篇文章的第二天)碰巧碰到的,碰到了这个链接 ,他们说这是VS API中的错误引起的。 I tried everything that they recommended and was unable to resolve it even temporarily: I had Autofac 2.6.x that I'd downloaded from google.code and then swapped it over for the NuGet package version and it willfully refused to see the new reference no matter what I did. 我尝试了他们推荐的所有方法,甚至暂时无法解决:我有从google.code下载的Autofac 2.6.x,然后将其换成NuGet软件包版本,它故意拒绝看到新的参考号。不管我做什么。

They suggest installing the R# 8 EAP but for me it was less hassle to just downgrade to the old version of Autofac. 他们建议安装R#8 EAP,但对我而言,只需降级到Autofac的旧版本就麻烦了。

Not much in the way of help, but maybe useful. 帮助的方式不多,但可能有用。


#3楼

Try Visual Studio → menu ToolsOptionsReSharper , Suspend button and Resume again (no need to close the window). 再次尝试Visual Studio→菜单工具选项ReSharper , 挂起按钮,然后再次继续 (无需关闭窗口)。 This works in my case. 这对我来说有效。


#4楼

For me, I think my solution just got caught in a weird state when I was changing which branch of my local Git repo I was on. 对我来说,当我更改本地Git存储库中的哪个分支时,我的解决方案陷入了一种奇怪的状态。 Simply switching to the previous branch I was on before the problem started, telling VS to reload all the files, then switching back to the desired branch and reloading again fixed it. 在问题开始之前,只需切换到我之前所在的上一个分支,告诉VS重新加载所有文件,然后再切换回所需的分支并重新加载即可解决该问题。


#5楼

I had similar problems and cleared the caches found at: 我遇到了类似的问题,并清除了位于以下位置的缓存:

AppData\\Local\\JetBrains\\ReSharper\\v7.1\\SolutionCaches AppData \\ Local \\ JetBrains \\ ReSharper \\ v7.1 \\ SolutionCaches

Solved the problems for me 为我解决了问题

Running VS2012 u3 运行VS2012 u3


#6楼

I'm using 7.1, and this worked for me: 我正在使用7.1,这对我有用:

  1. Uninstall resharper 卸载resharper
  2. go to %appdata% and remove JetBrains\\Resharper and ..\\Local\\JetBrains\\Resharper folders 转到%appdata%并删除JetBrains \\ Resharper和.. \\ Local \\ JetBrains \\ Resharper文件夹
  3. re-install resharper 重新安装resharper

ReSharper“无法解析符号”,即使在项目构建时相关推荐

  1. android xml 未能解析文件,Android Studio提示“无法解析符号”,但项目已编译

    我在build.gradle中使用以下内容在AndroidStudio中导入twitter4j: dependencies { compile 'com.android.support:support ...

  2. 解析复杂深度学习项目构建

    从tea出发 start_time = datetime.datetime.now()args = parser.parse_args() 导入相关参数 num_class, args.train_l ...

  3. 前端项目构建时内存溢出问题

    情景: 公司前台项目使用 gitlab 持续集成的方式去开发,但是在某一天更新代码时突然出现了这样的问题FATAL ERROR: Ineffective mark-compacts near heap ...

  4. 【QT开发笔记-基础篇】| 第一章 QT入门 | 1.4 项目构建流程

    本节对应的视频讲解:B_站_链_接 https://www.bilibili.com/video/BV1cW4y1y7Lw 在上一节课中,我们新建了第一个 Qt 工程,其中包括 5 个文件: Hell ...

  5. vue + iview项目构建

    最近在着手搭建自己的个人博客,确定技术栈为vue + node.js(express)+mysql,所以需要用vue写博客pc端以及后台管理系统页面,而UI组件则是用iview.把自己搭建项目的过程写 ...

  6. msbuild构建时用SVN修改版本号代替AssemblyVersion的Revision版本号

    持续构建需要标识出每次构建的版本,而每次构建的时候人工去修改版本是不现实的.靠程序去添加版本号,有3种可选:1) 顺序流水号:2) 时间戳:3) SVN检出代码的修订版本号 1) 顺序流水号.需要每次 ...

  7. vue 项目构建失败 Unhandled rejection Error 的原因 sass解析异常

    项目构建失败,出现 Unhandled rejection Error 看了一下是sass解析出了问题 经测试是 /deep/的使用,导致sass解析问题 vue中,sass某些版本不支持 /deep ...

  8. 项目构建错误:com.mabang:wms-api:0.0.1-SNAPSHOT 的不可解析父 POM

    报错信息: Project build error: Non-resolvable parent POM for com.mabang:wms-api:0.0.1-SNAPSHOT: Could no ...

  9. IntelliJ检查给出“无法解析符号”但仍编译代码

    平台:IntelliJ Community Edition 10.0.3 SDK:jdk1.6.0_21 作业系统:Windows 7 所以我在IntelliJ上遇到了一个奇怪的情况,这使我感到完全困 ...

最新文章

  1. java调用支付接口实例_Java 调用支付宝接口
  2. vs2005之主题与皮肤的学习
  3. Android系统架构开篇
  4. JUnit4套件测试
  5. 米斯特白帽培训讲义(v2)信息收集
  6. python入门——P48魔法方法:迭代器
  7. 第 4 章 Spring
  8. position 属性和 z-index 属性对页面节点层级影响的例子
  9. 错误解决办法:exec /usr/lib/ssh/ssh-askpass : No such file or directory error.
  10. 再理解:LNode、*LinkList
  11. PAT乙级——1034(模拟四则运算)
  12. commons-math3-3.6.1-org.apache.commons.math3.analysis.function-包下的类(三)-中英对照文档及源码赏析
  13. 任正非的“先僵化、后优化、再固化”方针
  14. win10自动修复失败无限循环_windows自动修复失败,无法启动
  15. 【心电监测】理论1-相关医学知识
  16. websocket通信中,send的使用
  17. dell远程控制卡的原理
  18. caffe与卷积神经网络
  19. 太原网络营销师揭秘每个老板最头疼的百度竞价(SEM)如何提供转化率?
  20. FFmpeg进阶:音视频滤镜概述

热门文章

  1. /D _WINDOWS, /D _CONSOLE
  2. 算法-----------乘积最大子数组(Java版本)
  3. Android 轮播Banner 实现 附代码
  4. JavaScript 仿ios滑动选择器
  5. 第十五周程序阅读-范型程序设计(5)
  6. 大年30还多少天_2020余额不足30天!年初许下的愿望你实现了多少?
  7. 创建型模式--原型模式
  8. 人工智能实践:TensorFlow笔记学习(四)—— 神经网络优化
  9. java中static、final、static final的区别
  10. mysql 储存过程