CS8032 warnings in EF Core project on Linux
I started evaluating Rider 2023.3 on Linux today and immediately ran into a compiler warning that's only partially reproducible with `dotnet build`.
- Create a new solution containing a .NET 6 library project.
- Add a dependency on `Microsoft.EntityFrameworkCore` 7.0.14.
- Build.
These warnings appear:
An instance of analyzer Microsoft.EntityFrameworkCore.InternalUsageDiagnosticAnalyzer cannot be created from /home/kevin/.nuget/packages/microsoft.entityframeworkcore.analyzers/7.0.14/analyzers/dotnet/cs/Microsoft.EntityFrameworkCore.Analyzers.dll : Could not load file or assembly 'Microsoft.CodeAnalysis, Version=4.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified..
An instance of analyzer Microsoft.EntityFrameworkCore.UninitializedDbSetDiagnosticSuppressor cannot be created from /home/kevin/.nuget/packages/microsoft.entityframeworkcore.analyzers/7.0.14/analyzers/dotnet/cs/Microsoft.EntityFrameworkCore.Analyzers.dll : Could not load file or assembly 'Microsoft.CodeAnalysis, Version=4.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified..
The same warnings appear when I build the project on the command line with `dotnet build --force`, but only once. If I immediately run `dotnet build --force` again, the warnings disappear. They do not reappear on the command line until I build again in Rider.
I installed Rider on Windows 10 but the problem is not reproducible there.
Please sign in to leave a comment.
These warnings went away when I installed Microsoft's dotnet-sdk-8.0 package instead of Ubuntu's dotnet-sdk-6.0.
Hello Kevin,
Thank you for contacting Rider support and for keeping me up to date.
I suppose the issue was caused by incompatibility of .Net 6 SDK you had installed with that package version microsoft.entityframeworkcore.analyzers 7.0.14
You might find this thread helpful: (github)(issue) Version Microsoft.CodeAnalysis 4.2.0 doesn't work
If there is anything else I can assist you with, please tell me.
Have a nice day!