Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
CS8032 analyzer warnings in empty EF Core project in Rider
I'm evaluating JetBrains Rider 2023.3 on Linux and almost immediately ran into a compiler warning that I don't understand. Attempting to isolate it, I created a new solution containing a .NET 6 class library project. The project has only one explicit dependency, Microsoft.EntityFrameworkCore
7.0.14. The project contains no class files. Build emits these CS8032 warnings:
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 sometimes appear with dotnet build
the command line and sometimes do not. I can consistently make them appear on the command line by running dotnet build --force
after a build in Rider, but only once:
- Trigger a build in Rider by editing a comment. Warnings appear.
- Run dotnet build on the command line. Warnings do not appear.
- Run dotnet build --force on the command line. Warnings appear.
- Run dotnet build --force again. Warnings do not appear.
Is this caused by something Rider is trying to do, or perhaps some misconfiguration?
1 answer
I resolved this by installing Microsoft's dotnet-sdk-8.0
instead of Ubuntu's dotnet-sdk-6.0
. Here's a loose summary of Microsoft's instructions.
- Remove existing dotnet packages:
sudo apt remove 'dotnet*' 'aspnet*' 'netstandard*'
- Deprioritize the Ubuntu packages by creating a file in
/etc/apt/preferences.d/
containing the following:
Package: dotnet* aspnet* netstandard*
Pin: origin "archive.ubuntu.com"
Pin-Priority: -10
- Add the Microsoft repo:
sudo apt-add-repository https://packages.microsoft.com/ubuntu/22.04/prod
- Install the .NET 8 SDK:
sudo apt update
sudo apt install dotnet-sdk-8.0
0 comment threads