18

In the last week, I've started having an issue with ReSharper giving me a "Symbol cannot be properly resolved" error with @angular/core components. However, I know that those components are properly installed and my solutions still builds, publishes, and runs correctly.

This has been addressed in the past (Visual Studio 2015 Enterprise with ReSharper 10 Ultimate — Cannot be properly resolved) and it seems that the only answer was to disable ReSharper and wait for them to put out an update resolving the issue. Following the instructions mentioned here, I was able to set up hotkeys for disabling/enabling Resharper.

The issue goes away when ReSharper is disabled. However, I was wondering if a better answer has come out in the last two years... disabling ReSharper doesn't exactly seem like a good solution.

(I'm using Visual Studio Community 2017 15.8.1 and ReSharper 2018.1.4)

enter image description here

JED
  • 1,538
  • 2
  • 19
  • 47
  • this keeps happening as of today with vs2022 and the latest resharper, going to disable r# for tsc once again – Ilias.P Aug 12 '22 at 09:03

2 Answers2

51

EDIT '19

Everytime R# gets an update, this answer gets upvoted, so I assume this problem occurs when something goes wrong after updating R# to the newest version. The solution still applies for me.

I usually do the same workaround, without reinstalling it and after I have updated to the latest version of R#:

  1. Clear caches in: ReSharper > Options > Environment > General
  2. Suspend Now in: Tools > Options > ReSharper
  3. Exit Visual Studio
  4. Delete .vs and obj folders
  5. Open Visual Studio
  6. Resume Now in: Tools > Options > ReSharper

Works for me all the time, but again, I am working under C# and the "solution" might not apply to you.

Neo
  • 4,145
  • 6
  • 53
  • 76
Nekeniehl
  • 1,633
  • 18
  • 35
  • It almost worked... now the `@angular/core` components are showing correctly but now a bunch of native components (Like `Number` and `Object` aren't working... maybe if I try it again. – JED Aug 23 '18 at 12:32
  • 1
    I expanded upon your instructions to get it to work... between steps 3 and 4, I deleted the ReSharper settings files (ReSharper > Manage Options > Reset All Settings), and then uninstalled and reinstalled ReSharper. If you add an edit to your answer, I'll happily accept it. – JED Aug 23 '18 at 12:35
  • It looks like what have fixed it was actually reinstalling it maybe? Have you tried before? – Nekeniehl Aug 23 '18 at 14:17
  • 3
    The original steps worked for me without a reinstall. – rybl Dec 10 '18 at 16:18
  • 1
    Visual Studio 16.2 update just triggered it for me. This solution as written continues to work. – quentin-starin Jul 25 '19 at 21:07
  • Ok, so this didn't work for me, and nothing else that I've tried has. However, after hours of trial and error, copying the the file where the missing symbol was located to a new name, then deleting the original file, letting ReSharper finish reanalyzing, and finally renaming the copied file back to the original name actually fixed it! – AlexPi Oct 31 '19 at 08:17
  • 1
    I got the issue after updating VS2019, the solution worked for me as well! – Sebastian S. Jan 29 '20 at 08:28
  • Update to latest VS 2019 triggered this for me as well and was also able to fix it with your step by step guide. Thanks! – Marco Heumann Jun 07 '20 at 15:35
  • 1
    Worked for me after updating visual studio. intellisense for typescript is working again. – ccook Aug 10 '20 at 11:59
  • Does anyone know how to fix this when it is happening in TeamCity's ReSharper code inspections? – Larry Flewwelling Sep 17 '21 at 15:19
  • I fixed TeamCity by reinstalling the build agent, deleting the cache when uninstalling. – Larry Flewwelling Dec 17 '21 at 17:48
  • 1
    I won't do this every time for every project so I didn't bother and just permanently suspended R# so +1 for figuring out what JetBrains seems to still not have the willingness or ability to fix. – ChiefTwoPencils Dec 27 '21 at 18:19
1

Usually it happens when you upgrade Resharper/Visual Studio to the newest version. Sometimes accepted answer doesn't help.

As a temporary solution before official fix you can set all *.ts files to be ignored by Resharper.

Resharper -> Options -> Code Editing -> Third-party Code -> Add file mask for *.ts files. Then restart Visual Studio. enter image description here

Sam Alekseev
  • 2,281
  • 2
  • 19
  • 28