开发者

Why do I get an error 'Cannot resolve symbol <symbolname>' in ReSharper?

Using VS2008 and R# 5 I'm running into an odd situation, where on an aspx page I keep getting

Cannot resolve symbol 'symbolname'

But the code compiles and runs fine. While having a fix for this would be great, I'm just trying to figure out if I'm losing my mind.

The CodeFile directive and Inherits directives are fine. If I compile the app or just let devenv sit for a bit it'll go away, but as soon as I save the aspx [via ctrl+s] R# suddenly has trouble with the Inherits attribute and flips out on every method in the page (OnClick etc).

// Anonymized of course开发者_StackOverflow社区 but otherwise intact
<%@ Page AutoEventWireup="true" CodeFile="TestPage.aspx.cs" Inherits="TestPage" Language="C#" MasterPageFile="~/MasterPage.master" Title="Test Page Title" %>

This is mostly just a grievance, because since the code compiles it doesn't stop me from doing what I need.

I would post a bug report to the JetBrains site but first I would like to know I'm not alone. It could be my machine. Maybe when I roll to VS2010 in a couple weeks this will go away?


In Resharper you can disable inspection for that file with: Ctrl + Shift + Alt + 8.


So no final resolution yet. According to tech-support this is a known issue and is being researched. Final resolution undetermined at this time. If you're experiencing a similar issue, just hang tight. URL: http://youtrack.jetbrains.net/issue/RSRP-178681


Nothing worked for me until I followed this answer -- removing the related reference from the Project/References and then adding it again.


This worked in my case (Visual Studio 2015): Go to Menu and select Options. From the opened window, select ReSharper Ultimate (yours might be different edition) and click Suspend. That will basically suspend all the resharper features. Then click "Resume"

That should work. Otherwise, try to clean Resharper cache.


I just tried something odd and it worked. In your page directive, change the AutoEventWireup to false, SAVE the file, then change it back to true. It's some connection between the aspx file and the designer I think.


Try delete your .vs folder (hidden folder). It will reset config and cache of your solution

Why do I get an error 'Cannot resolve symbol <symbolname>' in ReSharper?


Suspend and and restarting Reshaper worked. Issue was resolved.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜