Missing `Microsoft.AspNetCore.App` of version `2.2.8` on `Ubuntu 20.04` after clean installation - .net-core

Having issues with Ubuntu 20.04. I followed official instruction and installed both SDK & runtime. If can be confirmed from the terminal:
dotnet --list-sdks
3.1.403 [/usr/share/dotnet/sdk]
and runtime:
dotnet --list-runtimes
Microsoft.AspNetCore.App 3.1.9 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.9 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
...yet the project I am trying to dotnet run requires the Microsoft.AspNetCore.App 2.2.8 as can be seen from the log:
It was not possible to find any compatible framework version
The framework 'Microsoft.AspNetCore.App', version '2.2.8' was not found.
- The following frameworks were found:
3.1.9 at [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
You can resolve the problem by installing the specified framework and/or SDK.
The specified framework can be found at:
- https://aka.ms/dotnet-core-applaunch?framework=Microsoft.AspNetCore.App&framework_version=2.2.8&arch=x64&rid=ubuntu.20.04-x64
What's the correct way to install missing SDKs and runtimes?

So it comes out that Ubuntu 20.04 is not supported for above-mentioned runtime and one have to install them manually.
In my particular case it was enough to download binaries and run them as usual.

Related

Old version of Microsoft.NETCore.App cannot be found at release step

I have an error in my build pipeline on Azure DevOps. The project called DevPortalWeb fails in the Publish step.
The project is upgraded to netcore3.1 (it was created with earlier version).
DevPortalWeb -> C:\agent\_work\13\s\Application\DevPortalWeb\bin\release\netcoreapp3.1\DevPortalWeb.dll
DevPortalWeb -> C:\agent\_work\13\s\Application\DevPortalWeb\bin\release\netcoreapp3.1\DevPortalWeb.Views.dll
It was not possible to find any compatible framework version
The framework 'Microsoft.NETCore.App', version '2.0.0-preview1-002111-00' (x64) was not found.
- The following frameworks were found:
3.1.22 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
5.0.13 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
6.0.1 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
You can resolve the problem by installing the specified framework and/or SDK.
The specified framework can be found at:
- https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=2.0.0-preview1-002111-00&arch=x64&rid=win10-x64
C:\agent\_work\13\s\Application\DevPortalWeb\DevPortalWeb.csproj(45,3): error MSB3073: The command "dotnet bundle" exited with code -2147450730.
##[error]Error: The process 'C:\Program Files\dotnet\dotnet.exe' failed with exit code 1
What could be a reason, that the build pipeline requires previous version of the framework? There is no reference to version '2.0.0-preview1-002111-00' in the project now.
The problem was, that project was migrated from .NET Core 2.2 to .NET Core 3.1.
Several packages, including this one, do not target this version anymore. This is already included in version 3.0.
The migration documentation lists which packages are obsolete:
https://learn.microsoft.com/en-us/aspnet/core/migration/22-to-30?view=aspnetcore-6.0&tabs=visual-studio#remove-obsolete-package-references

Running dotnet core application (dll) without SDK

I'm trying to get my dotnet Core application running on an ubuntu 18.04LTS machine with dotnet core runtime installed.
The command:
dotnet myapp.dll
The result:
Did you mean to run dotnet SDK commands? Please install dotnet SDK from:
https://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409
As far as I understand I do not need the SDK for simply running this application. Just the runtime should suffice, right?
dotnet --info
Host (useful for support):
Version: 2.2.8
Commit: b9aa1abc51
.NET Core SDKs installed:
No SDKs were found.
.NET Core runtimes installed:
Microsoft.NETCore.App 2.2.8 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
How to make this work without installing an SDK?
It actually worked. I was running the dotnet command with the wrong path.. myapp.dll was nested a bit deeper. My mistake.

Unable to resolve 'Microsoft.EntityFrameworkCore.SqlServer (>= 3.0.0)' for '.NETCoreApp,Version=v3.0'

Good day,
I am trying to add a package named 'Microsoft.EntityFrameworkCore.SqlServer --version 3.0.0' in my ASP.NET Core Blazor application in VS Code. But I am getting the following error.
P.s. This is my first time working with VS Code.
Terminal
g:\Workspace\Test>dotnet add package Microsoft.EntityFrameworkCore.SqlServer --version 3.0.0
Writing C:\Users\dell\AppData\Local\Temp\tmpDB70.tmp
info : Adding PackageReference for package 'Microsoft.EntityFrameworkCore.SqlServer' into project 'g:\Workspace\Test\Test.csproj'.
info : Restoring packages for g:\Workspace\Test\Test.csproj...
error: Unable to resolve 'Microsoft.EntityFrameworkCore.SqlServer (>= 3.0.0)' for '.NETCoreApp,Version=v3.0'.
error: Package 'Microsoft.EntityFrameworkCore.SqlServer' is incompatible with 'all' frameworks in project 'g:\Workspace\Test\Test.csproj'.
.NET Info
g:\Workspace\Test>dotnet --info
.NET Core SDK (reflecting any global.json):
Version: 3.0.100
Commit: 04339c3a26
Runtime Environment:
OS Name: Windows
OS Version: 6.1.7601
OS Platform: Windows
RID: win7-x64
Base Path: C:\Program Files\dotnet\sdk\3.0.100\
Host (useful for support):
Version: 3.0.0
Commit: 95a0a61858
.NET Core SDKs installed:
3.0.100 [C:\Program Files\dotnet\sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
.csproj
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>
</Project>
A couple of posts suggested that I clear Nuget cache which I did. But still in vain.
g:\Workspace\Test>dotnet nuget locals all --clear
info : Clearing NuGet HTTP cache: C:\Users\dell\AppData\Local\NuGet\v3-cache
info : Clearing NuGet global packages folder: C:\Users\dell\.nuget\packages\
info : Clearing NuGet Temp cache: C:\Users\dell\AppData\Local\Temp\NuGetScratch
info : Clearing NuGet plugins cache: C:\Users\dell\AppData\Local\NuGet\plugins-cache
info : Local resources cleared.
g:\Workspace\Test>dotnet restore --force
Restore completed in 50.68 ms for g:\Workspace\Test\Test.csproj.
Thanks in advance.
If you are using any Visual studio IDE, try to delete/cut the nuget config file somewhere else.

Upgrading to .NET Core 3 in project that also uses netstandard2.1 is not building in Rider

I'm running on a macOS and the project I'm working on just upgraded from .NET Core 2 to .NET Core 3. The problem is that I can no longer build my project in Rider. If I try to build it in the terminal using dotnet build, the build succeeds. In my project, there are some subprojects that use netstandard2, but this should not be a problem (as its working in the terminal). I'm getting the following error message:
Project1 is not compatible with netcoreapp3.0 (.NETCoreApp,Version=v3.0). Project2 supports: netstandard2.1 (.NETStandard,Version=v2.1)
I have tried to add a global.json file which specifies I'm using version 3 of .NET Core, but it didn't help.
If I'm running dotnet build once in the terminal, then the new build of Rider will succeed. So things are working, but it is just annoying to always build in the terminal first.
The output of dotnet --info:
dotnet --info
.NET Core SDK (reflecting any global.json):
Version: 3.0.100
Commit: 04339c3a26
Runtime Environment:
OS Name: Mac OS X
OS Version: 10.14
OS Platform: Darwin
RID: osx.10.14-x64
Base Path: /usr/local/share/dotnet/sdk/3.0.100/
Host (useful for support):
Version: 3.0.0
Commit: 7d57652f33
.NET Core SDKs installed:
2.2.300 [/usr/local/share/dotnet/sdk]
2.2.401 [/usr/local/share/dotnet/sdk]
2.2.402 [/usr/local/share/dotnet/sdk]
3.0.100 [/usr/local/share/dotnet/sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.2.5 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.2.6 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.2.7 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.2.5 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.2.6 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.2.7 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.0.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.2.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 2.2.6 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 2.2.7 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 3.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
I found that the issue was in Rider. The workaround is to change PackageReference Restore Engine (in File > Settings > Build, Execution, Deployment > NuGet) to MSBuild.
The issue will be fixed in a later version of Rider, so it is recommended to switch back to Embedded after the version is relased. The difference between MSBuild and Embedded:
MSBuild just calls external MSBuild task; Embedded directly calls
NuGet API inside Rider process. Embedded should work much faster and
it provides additional logs which can be useful when restore fails
The reason for the issue:
[...] because Rider 2019.2 EAP2 still used NuGet 4.9 internally; this
version doesn't have proper support of .NET Core 3.0 / .NET Standard
2.1. In Rider 2019.2 RTM, we are going to upgrade the internal version of NuGet up to 5.1.
Source for quotes and screenshot:
https://youtrack.jetbrains.com/issue/RIDER-29888

ABP Update-Database error - The specified framework version '2.1' could not be parsed -

Just trying to create the database as part of the steps in this documentation.
Solution builds fine.
Message from Package Manager Console:
PM> Update-Database
The specified framework version '2.1' could not be parsed
The specified framework 'Microsoft.NETCore.App', version '2.1' was not
found.
Check application dependencies and target a framework version installed at:
C:\Program Files\dotnet\
Installing .NET Core prerequisites might help resolve this problem:
http://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409
The .NET Core framework and SDK can be installed from:
https://aka.ms/dotnet-download
The following versions are installed:
1.0.5 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
1.1.2 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
2.0.5 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
2.0.6 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
2.0.9 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
2.1.5 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
error copied from my VS window
Seems odd given that I have 2.1.5 installed. Can someone with ABP experience point me in the right direction? Thanks!
This is not an abp problem, but VS and dotnet core framework.
Scenario 1:
steps to follow
Update VisualStudio
Delete .vs folder
Restart PC
Run VisualStudio as administrator
This is what helped me.
Scenario 2:
Write PM> ls and check if the VS package manager is a corect dir, If
not cd folder and try again. If not working go to Scenario 1.
Scenario 3:
Copy your whole repository to C:/repo folder and try again.
If all of those wont work reinstall .NET core 2.1 framework.

Resources