Macbook + Rider + .Net Core console project: "Cannot resolve symbol 'void'" Follow
I have just installed Rider 2018.2.3 on my MacBook. I have macOS High Sierra version 10.13.6. I have never used Rider before - I am used to using Visual Studio.
I have opened a .NetCore 2.1 solution (containing a console project, a class library and an NUnit test project) in Rider. I have run dotnet restore on the command line. But I am getting basic errors in Rider like "Cannot resolve symbol 'void'" and "Cannot resolve symbol 'string'".
The project compiles and runs, but my code looks horrible because every other line has an error on it for every time there is a reference to void or string!
I found this post here: https://resharper-support.jetbrains.com/hc/en-us/community/posts/206028089-how-can-I-fix-this-cannot-resolve-symbol-void-
Suggestions there are as follows:
1) try clearing the whole %LocalAppData%\JetBrains\Transient folder
I am on a Mac and I don't seem to have this folder. As far as I am aware, LocalAppData is a Windows thing. I used Spotlight to search for a Transient folder but I don't seem to have one.
2) try to reassign your reference to System assembly.
I'm not sure what this means? How would I do this?
3) There was also something about clearing the cache, but again I'm not sure how to do this.
Does anyone have any suggestions for what I should do?
Thank you in advance.
Please sign in to leave a comment.
There is something slightly unusual about my solution, which might be relevant: There are two other projects in the root folder - one class library and one NUnit test project - but they are not included in the solution file. They both have .Net Core project files.
Is there any error messages in the event log (right-bottom corner)? Please check that Rider has detected .NET Core MSBuild (Use MSBuild version field in "File | Settings | Build, Execution, Deployment | Toolset and Build"). Please share a screenshot of this setting.
In solution explorer check project references (are there yellow triangles?)
Also, please, share your backend.log (Help | Show Logs in Finder) and csproj files via https://uploads.services.jetbrains.com/ and let me know the exact file name.
I have managed to fix the issue. While I was attempting to answer your questions, I noticed that I had accidentally left a reference in csproj to a project that isn't actually included in the solution (because it contains Office.Interop references that only work in .Net Framework). I removed the reference from the csproj file, and that fixed the problem.
Incidentally, I had a couple of difficulties following your instructions:
1) On a Mac, the MSBuild version field is in "JetBrains Rider | Preferences | Build, Execution, Deployment | Toolset and Build". There is no File | Settings menu item, just File | Import Settings, File | Export Settings and File | Settings Repository.
2) You asked me to check project references, and I couldn't find them because they were hidden in Solution Explorer under Dependencies | .NETCoreApp 2.1, which I didn't initially expand as I thought it was just a reference to .NetCore.
In case it is any help, the answers to your questions were as follows:
1) There were no error messages in the event log.
2) Rider had detected .NET Core MSBuild as "Auto detected (15.0)" at /usr/local/share/dotnet/sdk/2.1.403/MSBuild.dll.
3) There were no yellow triangles for project dependencies
There was something else though: It said "has missing packages" against the project name in Solution Explorer, even though I had run dotnet restore (see screenshot)
Thank you for your help.