I created a GitHub Gist with the output of the commands I used to remove and install dotnet-sdk-3.1 then create a single C# app using the dotnet command.
Here is some up-front information about my system and dotnet on it.
➜  dotnet-core-sample dotnet --list-sdks
3.1.301 [/usr/share/dotnet/sdk]
➜  dotnet-core-sample dotnet --version
3.1.301
➜  dotnet-core-sample uname -a
Linux localhost.localdomain 5.6.18-300.fc32.x86_64 #1 SMP Wed Jun 10 21:38:25 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
➜  dotnet-core-sample cat /etc/os-release 
NAME=Fedora
VERSION="32 (Thirty Two)"
ID=fedora
VERSION_ID=32
VERSION_CODENAME=""
PLATFORM_ID="platform:f32"
PRETTY_NAME="Fedora 32 (Thirty Two)"
ANSI_COLOR="0;34"
LOGO=fedora-logo-icon
CPE_NAME="cpe:/o:fedoraproject:fedora:32"
HOME_URL="https://fedoraproject.org/"
DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/f32/system-administrators-guide/"
SUPPORT_URL="https://fedoraproject.org/wiki/Communicating_and_getting_help"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION=32
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION=32
PRIVACY_POLICY_URL="https://fedoraproject.org/wiki/Legal:PrivacyPolicy"
                        Seems that this is also affecting OmniSharp Roslyn as well making it so it can't load the sln file or the csproj files.
Thanks for the extensive logs. It looks like you have a mixed set of Microsoft-built and Fedora 32 .NET packages--the fc32 indicates the first group is Fedora distro packages:
aspnetcore-targeting-pack-3.1-3.1.3-1.fc32.x86_64   
dotnet-targeting-pack-3.1-3.1.3-1.fc32.x86_64       
netstandard-targeting-pack-2.1-3.1.103-1.fc32.x86_64
aspnetcore-runtime-3.1-3.1.5-1.x86_64               
dotnet-apphost-pack-3.1-3.1.5-1.x86_64              
dotnet-host-3.1.5-1.x86_64                          
dotnet-hostfxr-3.1-3.1.5-1.x86_64                   
dotnet-runtime-3.1-3.1.5-1.x86_64                   
dotnet-runtime-deps-3.1-3.1.5-1.x86_64              
dotnet-sdk-3.1-3.1.301-1.x86_64                     
These install to different locations, so while dotnet is installed in /usr/share/dotnet/, the targeting pack was installed to /usr/lib64/dotnet/. This is why the build can't find them. (There are other differences, but this is the one that bit.)
Here's an earlier instance of the problem: https://github.com/dotnet/core/issues/4605#issuecomment-618524478
I would suggest using either the Microsoft packages for .NET Core, or the Fedora packages for .NET Core. Mixing them is probably not a safe thing to do.
I think the easiest way to stop mixing is to remove the Microsoft package repo (I believe that's rm /etc/yum.repos.d/microsoft-prod.repo to reverse the instructions) and reinstall again, to get them from the Fedora 32 distro.
We have https://github.com/dotnet/docs/issues/18347 tracking getting our documentation in shape to handle this, since it'll probably be a somewhat common issue as people move onto the distro packages, in particular after running a distro upgrade from Fedora 31 => Fedora 32 if the Microsoft feed tags along. 😕
/cc @omajid @NikolaMilosavljevic @dleeapho @MichaelSimons
Disabling the repository using:
sudo dnf config-manager --set-disabled packages-microsoft-com-prod
Then uninstalling the binaries and reinstalling with the F32 provided packages did the trick. Thank you very much.
Most helpful comment
Disabling the repository using:
Then uninstalling the binaries and reinstalling with the F32 provided packages did the trick. Thank you very much.