8

enter image description here

I believe, the error message not related to Serilog specifically, but is rather because of the code/assembly/package specific structure/modifiers etc.

So, the issue is that Resharper shows the error (and the code (from assembly referenced) is not accessible for navigation to) when Visual Studio navigates (by Go to Definition command) to metadata and compiles the code well (including, showing the method description successfully as well).

The method is defined in assembly as follows:

namespace Serilog
{
    public static class Log
    {
        public static ILogger ForContext<TSource>();

My current version of Visual Studio: 2017 (15.4.4) Resharper: 2017.2.2

Generally, everything works well for me, but because of "lost" definition, my object defined (Logger) indicated as unresolved through the whole code, so all my scrolling bar is red with error notes, which is quite confusing.

Any thoughts?

Community
  • 1
  • 1
Agat
  • 4,577
  • 2
  • 34
  • 62

1 Answers1

20

This following seems to work for me most of the time

Solution 1

Tools->Options->ReSharper 
  • Suspend Now
  • Resume

It refreshes the cache and/or some other dark magic


Solution 2

You could try clearing the ReSharper cache implicitly

ReSharper->Options->Environment->General 
  • Clear Caches.

Solution 3

You can also try unloading and then reloading the project.

Solution Explorer->Right Click
  • Unload Project
  • Reload Project

Solution 4

As a last resort you can try to delete the solution cache manually

%LOCALAPPDATA%\JetBrains\Transient\ReSharperPlatformVsXX\vXX\SolutionCaches\
TheGeneral
  • 79,002
  • 9
  • 103
  • 141
  • 1
    Thanks for the quick answer! And the Solution 1 magically has resolved the issue! I am quite surprised Resharper had that issue which can be solved this way! I believe I had that error from the beginning of cloning the sources of the project. – Agat Feb 07 '18 at 02:30
  • 1
    @Agat no problems :) computers suck – TheGeneral Feb 07 '18 at 02:30
  • "Solution 2" works for my problem with TypeScripts: Cannot resolve symbol 'window' etc. Also VS restart is needed. "Solution 1" was not enough. – CoperNick Sep 23 '19 at 16:54