简体   繁体   English

Resharper:无法在VS2010 SP1中解析符号'Eval'

[英]Resharper: Cannot resolve symbol 'Eval' in VS2010 SP1

I just installed SP1 for VS2010, and since then I get error messages from Resharper for stuff that used to work and be ok for Resharper (5.1) before. 我刚刚为VS2010安装了SP1,从那时起我从Resharper那里得到了以前工作的错误消息,并且之前可以使用Resharper(5.1)。

The error messages are "Cannot resolve symbol 'Eval'" and some other methods other than Eval. 错误消息是“无法解析符号'Eval'”以及除Eval之外的其他一些方法。

How do I solve this? 我该如何解决这个问题? Is there a fix? 有修复吗? Is there some resharper cache that I must delete/clear? 是否有一些resharper缓存我必须删除/清除?

(The code compiles and runs as usual) (代码编译并像往常一样运行)

I would try deleting the _ReSharper.{SolutionName} directory completely if clear cache fails. 如果清除缓存失败,我会尝试完全删除_ReSharper.{SolutionName}目录。

You might want to close VS2010 before you do that. 您可能希望在执行此操作之前关闭VS2010。

EDIT: Try this only if @Andrew Finnell solution doesn't work. 编辑:只有在@Andrew Finnell解决方案不起作用时才尝试此操作。

尝试:

Resharper Menu -> Options -> General -> Clear Cache button

I had this problem in spades in my multi-project VS solution. 在我的多项目VS解决方案中,我在黑桃中遇到了这个问题。 Tried Julien + Andrew's solutions and they did not resolve the issue. 试过朱利安+安德鲁的解决方案,他们没有解决问题。 But everything compiled just fine and worked as normal -- it was simply the "Errors in Solution" that kept showing the errors (which also showed up when you looked at the code in the right-hand-ReSharper-margin). 但是一切都编译得很好并且正常工作 - 只是“解决方案中的错误”一直显示错误(当你查看右手ReSharper边距中的代码时也会出现错误)。

It turns out I had inadvertently deleted the web.config file in one of the solution's web projects during some version control operations. 事实证明,在某些版本控制操作期间,我无意中删除了其中一个解决方案的Web项目中的web.config文件。 Who knew that thing was important? 谁知道那件事很重要?

I restored the web.config file, cleared the cache and deleted the R# cache directories and then rebuilt all of the projects individually and the issues went away. 我恢复了web.config文件,清除了缓存并删除了R#缓存目录,然后单独重建了所有项目,问题就消失了。

Phew! 唷!

The solutions of @Andrew Finnell and @Julien Bérubé, alone and combined, did not fix my problem of "Cannot resolve symbol". @Andrew Finnell和@JulienBérubé的解决方案,单独和合并,并没有解决我的“无法解决符号”的问题。

The comment of @bdwakefield pointing to here finally shed light on my problem. @bdwakefield指向这里的评论终于揭示了我的问题。

It turns out that my "not resolved symbol" contains a web reference, and ReSharper gets lost there somehow. 事实证明,我的“未解决的符号”包含一个Web引用,并且ReSharper以某种方式丢失。

By the link above it is possible to see that this is also an issue for many people, but JetBrains guys were not able to reproduce the error until now (see here ). 通过上面的链接可以看出这对许多人来说也是一个问题,但JetBrains的家伙直到现在才能重现错误(见这里 )。

I was having the same problem with one of my projects. 我的一个项目遇到了同样的问题。 I reported the issue to JetBrains and they requested a VS solution which has the problem. 我向JetBrains报告了这个问题,他们要求VS解决方案存在问题。

So, I decided to spend a few hours trying to narrow down the problem as much as possible. 所以,我决定花几个小时尽可能地缩小问题的范围。 I found out that the issue is related to a tool I use which strips out information from .DLLs. 我发现这个问题与我使用的从.DLL中删除信息的工具有关。

If I don't strip the .DLLs, Resharper works fine without showing any “cannot resolve symbol” errors. 如果我不删除.DLL,Resharper工作正常,没有显示任何“无法解决符号”错误。 However, If I do strip the .dll, then ReSharper starts to show these “cannot resolve symbol” errors. 但是,如果我删除.dll,则ReSharper会开始显示这些“无法解析符号”错误。 In both cases, Visual Studio compiles the program and the program runs fine. 在这两种情况下,Visual Studio都会编译程序,程序运行正常。

I am working with JetBrains to get the issue resolved. 我正在与JetBrains合作以解决问题。

In the mean time, I am able to workaround the problem by using versions of my .DLLs which do not have any information stripped out of them. 与此同时,我能够通过使用我的.DLL版本解决问题,这些版本没有任何信息被剥离。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM