In Rider 2020.1.3 on macOS Catalina. I'm not normally a C# dev, so apologies for incorrect terminology.
This is a .NET api containerized with Docker. Rider is randomly seeming to lose connection to the dotnet core libraries. It will be fine and then I'll walk away and come back and get "cannot resolve symbol 'Microsoft'" or "cannot resolve symbol 'System'" on all the imports (see attached screenshot), which of course trickles down to none of their methods being recognized either. When I build it at this point I get this error:
Microsoft.PackageDependencyResolution.targets(208, 5): [NETSDK1004] Assets file '/app/[applicationName]/obj/project.assets.json' not found. Run a NuGet package restore to generate this file.
Doing a NuGet package restore tells me all packages are restored, and the file it mentions exists at that location (however, it says 'no index' next to it, but not sure what that means).
The first time it happened seemed to be because the SDK I had installed locally (3.1) was different than the one used in the project (2.2). I installed 2.2 on my machine and that fixed the issue for a bit.
The second time it happened, later in the day after the first time, it seemed to be because Rider was favoring the 3.1 install in the Toolset and Build settings. So I deleted the 3.1 install from my system, and it fixed the issue for about a day.
I get back on today and it's happened again. I've tried various things I've found Googling around: unchecking 'Use Resharper Build,' adding some things to the .dockerignore, verifying there's not a %20 in the top-level dir as a result of the clone.
I am not sure what info would be relevant at this point; please let me know if some parts of the code or file structure are needed to help troubleshoot. The root of the entire project contains the directory for the API referenced here, the directory for the app, which is React, and the docker-compose.yml. The API has its own Dockerfile, as does the app.
Edit:
What ended up fixing it was going through these steps to remove dotnet completely and then redownloading 2.2
-f (--framework)
should help picking a framework of choice, such as learn.microsoft.com/en-us/dotnet/core/tools/dotnet-build Also try specifing--force
it forces all the dependencies to be resolved. – Atheist