Cannot resolve symbol issue with resharper but code compiles - visual-studio-2010

I know this has been asked before, but there was no solution to the problem, and it was last year, so I thought maybe someone has found something to solve this by now.
I am using VS2010 with SP1. before installing the SP1 there was no problem. if I uninstal re# it works fine. I have an ASP.Net website and some other projects. The classes from the other projects are not recognized, resharper suggests using the other project, so I do so, it puts it up at the usings, then the using also gets a "cannot resolve symbol".
I have tried the suggestions they gave in 2011 here but nothing.
if I delete the _Resharper. and restart vs, it will work for 5 seconds, then all red again...
hope someone found a solution to this since then...thanks
Edit: I have noticed it does this with Web Services

Although this question is rather old it happended to me today. I solved it by going to menu Tools -> Options -> Resharper
Click on Options and press Clear Caches button followed by Save.
Then just click on the Suspend Now followed by Resume Now button to restart Resharper and your code should be ok again.
EDIT: happened to me again. Clearing caches helped. The only thing changed is that "Clear caches" is hidden under General tab in resharper options.

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.
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.
If I don’t strip the .DLLs, Resharper works fine without showing any “cannot resolve symbol” errors. However, If I do strip the .dll, then ReSharper starts to show these “cannot resolve symbol” errors. In both cases, Visual Studio compiles the program and the program runs fine.
I am working with JetBrains to get the issue resolved.
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.

in visual studio, Tools -> Options -> Resharper, Press Suspend Now
delete the folder _ReSharper.*
Tools -> Options -> Resharper, Press Resume Now

Related

Cannot edit checked out file (TFS) in Visual Studio 2013

Since I changed my windows password I can no longer type into a checked out file in Visual Studio 2013! Where before I just needed to start typing and it would check out the file in the background, now it won't even allow me to type into the file after I manually check the file out, from the solution explorer! It's as if VS 2013 is ignoring the keyboard on the project under source control. It's fine for other projects even project's under source control!
I think I remember seeing this before with older versions of Visual Studio and resolved it with a "Go online" option but I can't see that option in VS 2013, or the project is not "off line" so the option is not available.
This is obviously related to the TFS setting on the project but I simply cannot get past it. I am blocked and would appreciate any suggestions.
I suspended Resharper and restarted Visual Studio 2013. Once I reopened it the problem was gone. Resuming Resharper caused the problem to emerge again.
The solution is quite large so maybe that is it. Before putting Resharper into suspend mode I tried switching off code analysis thinking the workload is just too great, but that didn't help. The suspend did though. I hope this helps anyone else with the same issue.
All I have to do now is to figure out how to get Resharper back in the game without the problem coming back. We rely on Resharper as it is an wonderful tool. Since the solution has many projects in it, I am going to try create a smaller solution with my web project and just reference the other projects as assemblies. Maybe that will help
Update:
Clearing the resharper cache as suggested by Alexander resolved the original issue.
I'd like to add Alexander's comment as answer, since it helped me exactly to solve the issue:
Clean R# (ReSharper) caches by deleting all folders (and files) from the path
C:\Users\{User Name}\AppData\Local\JetBrains\ReSharper\v8.2\SolutionCaches\
and then reopen the solution.
Note: (Thanks to Antak for providing this info!)
You can paste
%userprofile%\AppData\Local\JetBrains\ReSharper\v8.2\SolutionCaches
into file explorer's path textbox (open it via Win+E, or use Win+R and paste the path into the command window), this will resolve the physical path into your user's directory automatically.
This happened to me. All my JavaScript files went "dead." By "dead" i mean that all the normal VS intellisense coloring/functionality was gone; js files were un-editable, although Resharper was still working sort of; all other non-js files seems to be normal. In addition to Resharper, I had also previously installed Web Essentials and was using both tools.
First, I cleared the R# caches as mentioned above by Alexander. After restarting VS, this DID NOT work. JS files still dead.
Then i disabled Web Essentials. Then I restarted. THIS WORKED.
I then re-enabled Web Essentials, restarted again, and all seems to be OK. Am crossing my fingers....
I too had this problem with the latest version of ReSharper (9.0.0.0), but clearing the cache as stated above did not work. I actually had to go into my ReSharper options (ReSharper -> Options -> General) and click the "Clear Caches" button. Once I did this and restarted VS everything is working again.
Try: /safemode
I had a similar problem where I could not edit most of my files, but I could edit *.ps1 files.
I don't have TFS, I do have resharper and other plugins.
What worked for me was:
Start visual studio in safe mode: C:\..\IDE>devenv /safemode
Close VS.
Start VS normally.
That probably has the same effect as suspending and resuming resharper, but I'm not sure which plugin could be causing the problem. If you are having trouble this is something you could try.
I hit the refresh(restart) and it solved a similiar problems so maybe you better try that before an IDE restar. ctrl shift F5

Potential Visual Studio Issue: Can't resolve symbol but works fine?

I feel like either this is an issue in Visual Studio or I'm crazy.
Ingredients
I'm using:
Visual Studio Professional 2012 (11.0.61030.00) Update 4
ReSharper 7
xUnit for tests
FluentAssertions in my test code.
The Issue
Just recently, resharper showed me an issue:
I navigated to the file, and sure enough, there seemed to be the issue in the code.
But I'm referencing FluentAssertions:
And if I clean and rebuild the entire solution, I get no errors:
And all of the tests even run correctly:
Questions
Why would this just start showing up after installing Visual Studio Update 4?
What can I do to make it go away?
Is there actually a problem with something, or if tests & code run fine and no errors appear, is it not an issue at all?
First time I've seen anything like this so I'd appreciate any insight.
This could be for several reasons, such as NuGet package restore - if the packages (and therefore the assemblies) weren't there when the solution was opened, ReSharper will mark them as undefined. It's usually pretty good at noticing and reindexing when the assemblies are added, but perhaps it missed them here. Sometimes opening the file again will cause the errors to be reindexed, sometimes it requires the solution to be closed and reopened.
Alternatively, and what is probably the most likely way to fix, is to go to ReSharper -> Options -> General and click Clear Caches. ReSharper will rebuild the solution cache, and should reindex everything and get rid of the errors.
In this case, the solution appears to be the old "Restart the PC" trick.
If anyone knows how an issue such as this could be resolved without restarting the PC, I'm happy to award you the answer.
Check you don't have any old missing references, just noticed on my solution the same issue removing old missing references did the trick for me.

How to make ReSharper re-evaluate its assembly reference highlighting

I am creating a Prism Project Template, and the template works great. But after I create a project with the template some of the files look like this:
Despite appearances, everything is just fine.
If I do a Rebuild All I see that the solution builds with no errors:
But the rebuild all does not get rid of the "errors" that are showing in the editor window. (Note that the actual error window does not show any errors.)
I can clean, rebuild, close and open files, and it will not fix the highlighting.
However, if I close the solution and re-open it, all is well:
My Question:
Ideally there would be a way for my template or my IWizard to tell ReSharper to reload the references for the highlighting.
I know I can turn ReSharper off and then on again and that will fix it, but I would rather not do that.
Is there a ReSharper command that just refreshes this stuff?
Except for reinstalling, the only way to successfully clear the caches is to delete the files manually from your AppData directory.
Delete the solution folder that's giving you grief in the following locations:
%LOCALAPPDATA%\JetBrains\ReSharper\v7.1\SolutionCaches\
%LOCALAPPDATA%\JetBrains\Transient\ReSharperPlatformVsXX\vXX\SolutionCaches\ for newer versions.
Note that the version numbers in the paths may be different depending on the ReSharper version that is installed.
The XX in vXX and VsXX represents any number, because there might be multiple folders where the solution cache is stored.
Try unloading and then reloading the project.
To unload the project, right-click the project in the solution explorer, and select Unload Project. Then, right-click the project again and select Reload Project.
The issue continues to occur occasionally with the latest versions of ReSharper, but the fix seems to work for every version.
You could try clearing the ReSharper cache via menu ReSharper → Options → Environment/General → button Clear Caches.
This worked for me. There is no need to reload projects. You can do this from within Visual Studio.
Clear the ReSharper cache via ReSharper, Options, General, click 'Clear Caches'.
ReSharper, Windows, select 'Solution Errors'. This will launch the Solution Errors window. At the top of this window, click the button to 'Reanalyze Files With Errors/Warnings'.
Open ReSharper - Options - Environment - General, scroll down to Msbuild access and select Obtain data from msbuild after each compilation.
This worked for me, using ReSharper 10.0.1 with ReSharper Build.
Go to ReSharper → Windows → Solution Errors Window, and you will get an overview of the errors in your solution. There, you can click the button Reanalyze Files With Errors.
If you want, you can assign a shortcut to this. Go to Tools → Options → Keyboard, and search for "Reanalyze". You can assign a keyboard shortcut to either 'ReSharper_ErrorsView_ReanalyzeAllFiles' or 'ReSharper_ErrorsView_ReanalyzeFilesWithErrors'.
I have a similar issue with nuget packages and I found a most weird workaround: select the reference in project reference list and press 'F4'. Somehow properties window appearance causes resharper to reevaluate available references...
I am not certain this is the same root cause, but I discovered that, within the ReSharper options, "Use MsBuild" was checked and I got all sorts of erroneous errors reported. Try checking "ReSharper->Options->General" and see what state the "Use MsBuild" check is in.
Go to ReSharper → Options → General and click Clear Caches. (I have 8.2, so if you're on a different version it may be elsewhere.)
You'll then need to re-open your solution, and ReSharper will re-analyse everything.
Run the following code in a command prompt. Then solve the ReSharper issue...
del /q/f/s %TEMP%\*
The only thing that helped me is: Unistall and than Install Resharper again (Repair didn't work)
Visual Studio 2010 SP1, ReSharper 7.1.3000.2254
This is a strange issue, and is still alive and well in version 8.2.3 (build 8.2.3000.5176).
What seems to work for me on a consistent basis is to do a solution rebuild.
In VS 2013: Build -> Rebuild Solution
If the solutions above don't work you can try resetting the project output type. This seems to fix the issue on VS2015 Update 1 with ReSharper 10.1
For me none of the above worked. I had to install the new version of Resharper which supports NET Core 2.0.
Resharper was reporting a missing reference from a project that was included in the references. After trying the other solutions here, I disabled Resharper via the instructions this answer, and I found that Visual Studio's intellisense still reported the same errors.
At this point, I realized there was probably something wrong with the project file. I suspected a reference had gotten subtly corrupted during a merge.1
I deleted the reference it was complaining it couldn't find and re-added it. The errors from Visual Studio went away. Then I re-enabled Resharper, and it was no longer complaining about errors in my project.
When I checked to see what had changed in the csproj file, what I found was an extra </Compile> that had no corresponding open tag. So it was indeed a merge error.

Visual Studio removes line break on start

I have the problem that Visual Studio (or maybe Resharper?) removes line breaks when I try to start my application. This happens in a way that when I press F5 or click on the run button with the mouse that a line break at the line where the cursor was the last time will be removed which is extremely annoying.
I have not tried so many things yet because I really don't know where to start. I never experienced this problem before and was always working with the same setup:
Visual Studio 2010
Resharper 6.1.1
Other plugins I use but which were installed after the problem (so I think they should not be related to the problem):
AnkhSvn
TeamCity
Example:
Before:
public void test(){
int x = 5;
}
After running the solution:
public void test(){
int x = 5;}
Edit: This issue seems to be related to Resharper - so hopefully they will be able to fix this issue as I never had this with any previous versions. (http://devnet.jetbrains.net/message/5456038#5456038).
This is a problem with Dexexpress Dim#ster patch. If you delete licenses.licx and compile in the source code. Not happend. The problem is when you open a form and licenses.licx is created again. Is you uninstall the patch this dissapear. But I dont understand why deactivating Resharper the problem gone too. But without patch and resharper + devexpress trial working fine.
The problem is the patch.
I'd do this before reinstalling:
Uninstall All plugins
Type devenv.exe /resetsettings
Now try and use your code as described without plugins. Slowly add back your plugins if its ok and check after each is installed if the problem manifests itself. if not it was some setting in one and its now gone, if it comes back after one is installed you have a good thing to look at.
Just blatting the environment means you'll never find out whats causing it, which would annoy me :)
Have a look at ReSharper's Braces-settings: http://www.jetbrains.com/resharper/features/code_formatting.html#Code_Style_Configuration_and_Sharing (1st screenshot). Try changing those settings according to your needs.
If you're a member of a team, maybe someone else enabled sharing of "code style settings". See the previous link for that, 2nd screenshot.
Does it also occur when you just build the project?
In the build options try doing clean project, then open close the program. After this do a rebuild project. Also make sure the project is in debug mode for testing =)!
Delete the settings resharper in solution. Helped me.
I know that this question is a little bit old. But this may help anyone who encountered the same error with resharper and devexpress controls. I've tried all the above instructions, but the nothing works. BTW I'm using visual studio 2017 with resharper 2017.2.2 and devexpress 17.2.3
This what works for me.
Open build&run window in resharper. Click Resharper>Windows>Build&Run to open the the window then select "Enable 'Resharper Build'. Open any file in text editor and move the cursor at the end of any line of codes or on any empty line and try to build the project to see if it works.
Hope this will help.
At this point I would suggest uninstalling and reinstalling VS. Then add ReSharper and any of your extensions one at a time.
I had the same problem. I use this prebuilt-event script
break>$(ProjectDir)\Properties\licenses.licx
I have ReSharper 10.0.2, VS2013, DevExpress Components and VisualSVN.

Visual Studio 2010 intellisense stopped working

I've got a small problem with the VS2010. I installed Resharper and soon after my installation period has expired, My Visual Studio 2010 Intellisense stopped working. Its very hard to work without Intellisense. It doesn't even show the member properties even . I tried doing devenv.exe /ResetSettings and I end up with an error saying:
it is not recognised as a internal or external command, operable program or batch file.
My solution
I don't know how people are solving this but I just solved my above problem by resetting the Vs settings. Tools-->Import ExportSettings-->selecting the reset all settings and following the wizard .
By doing this of course I lost the little settings I made just like adding line numbers and stuff, but I did that again.
Not sure if this is the ideal solution for people looking for an answer, but just helped me to get the Intellisense in the first place which I was actually looking for.
This worked for me.
http://miguelmoreno.net/post/Intellisense-not-working-in-Visual-Studio.aspx
In Visual Studio select Tools > Options > Text Editor > All Languages. Ensure that the checkboxes in the Statement Completion section are actively checked (not grayed out).
For risk of sounding like tech support:
Reboot your machine and check if Intellisense is back, else try devenv /ResetSettings again.
I tried to reboot and devenv.exe /resetsettings.
What actually worked for me was the following:
Goto Tools > Options > Resharper
Suspend Resharper
Resume Resharper
No application restart or PC reboot or anything required after that.
Found here: http://geekswithblogs.net/GruffCode/archive/2010/11/09/resolving-issue-ldquoresharper-auto-completion-live-templates-and-intellisense-stop-working.aspx
Saving my project then restarting VS worked for me.
I accidentally had two of the same file open in the IDE. After closing one of them, intellisense started working again! This is how you can reproduce it:
Drag a tab onto your desktop, then open the same file by double clicking it in the Solution Explorer. You now have 2 of the same thing open. You can now drag that floating window back into the IDE as a tab and now you (unfortunately) have 2 of the same file open at the same time. You can only edit the original one and the other one will drive you crazy.
#Ronald McDonald, I tried that solution, but everytime I go back in, the Statement Completion options are reset, so that the boxes are filled, not checked (i.e. on for some languages, off for others). I'm guessing that it's ReSharper responsible?
For anyone else having this problem, if the above solutions don't work, and you have ReSharper, give this a try:
Reset key mappings in Visual Studio: Make sure only one instance is running. Tools -> Options -> Environment -> Keyboard -> Reset.
Restore ReSharper keyboard shortcuts: ReSharper -> Options -> Environment -> General -> ReSharper keyboard shortcuts. Close Visual Studio.
It's too early to tell, but I think (hope) that this has worked for me. I keep losing not only Intellisense, but undo/redo stops working (even greys out in the Edit menu, until I reopen the menu a few times), along with copy/paste and most (sometimes all) Ctrl+ keyboard shortcuts. I've had this problem for years, on different computers, and I'm pulling my hair out trying to fix it. I really hope this one finally worked!
First check in VS tools-> options-> editor -> statement completion is checked (not grayed out).
Then follow this procedure:
close all open files in the VS IDE.
Save & restart VS.
Make sure the file you are writing into is included in the project (and not excluded by mistake)
If this does not solve the problem, close VS & try from the command line running: devenv /ResetSettings
else try installing the hotFix: http://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=26662
cheers
Change the path location for the project . If it exist in some folder then place it into another.
This will solve the issue
Intellisense stopped working. Tried the methods suggested here to no avail. Noticed it was only affecting only the current file. Closed Project, deleted the .suo file and restarted project. It is now working for all files. :)
If using ReSharper:
ReSharper / Options... / "Clear Caches".
Quit and restart Visual Studio.
I found that I had mistakenly uninstalled SQL Server Compact 3.5 SP2.
Re-installed, then set Options->TextEditor->Advanced->Disable Database = False
worked for me.

Resources