I've got two projects in Visual Studio, where classes in the first one refers to classes in the second. The first project is a .netcore app, with the following in it's project file:
<TargetFramework>netcoreapp2.0</TargetFramework>
The second project has multiple target frameworks:
<TargetFrameworks>netstandard2.0;net461;net462</TargetFrameworks>
Both projects compile and work fine, but classes located in the the second project appear red in code in the first project, as if there is a reference error. For context, here's a generic example:
The smudged out red part is a class defined in the other project. I can navigate to it (using F12 / "go to definition" or ctrl + click), but when I hover the cursor above the red text, is says
Cannot resolve symbol 'MyClassName'
So just to be absolutely clear: Everything still works - it's just that Resharper erroneously reports a reference error her, and that bugs me.
How do I know resharper is causing this? Because if I disable Resharper (Tools -> Options, search for resharper and click "suspend"), the error disappears:
Enabling Reshaper again causes the error to return immediately.
I suspect this has something to do with the types of projects (i.e. their target frameworks), but I haven't been able to figure it out exactly.
Any ideas about how get rid of these errors?
Resharper shenanigans
Solution 1
Tools->Options->ReSharper
It refreshes the cache and/or some other dark magic
Solution 2
You could try clearing the ReSharper cache implicitly
ReSharper->Options->Environment->General
Solution 3
You can also try unloading and then reloading the project.
Solution Explorer->Right Click
Solution 4
As a last resort you can try to delete the solution cache manually
%LOCALAPPDATA%\JetBrains\Transient\ReSharperPlatformVsXX\vXX\SolutionCaches\
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With