This is ordinary console application, I have installed in my computer NET.CORE, look to result of dotnet --info
.NET SDK (reflecting any global.json):
Version: 5.0.202
Commit: db7cc87d51
Runtime Environment:
OS Name: Windows
OS Version: 10.0.19042
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\5.0.202\
Host (useful for support):
Version: 5.0.5
Commit: 2f740adc14
.NET SDKs installed:
1.0.0-preview2-003131 [C:\Program Files\dotnet\sdk]
3.1.408 [C:\Program Files\dotnet\sdk]
5.0.102 [C:\Program Files\dotnet\sdk]
5.0.104 [C:\Program Files\dotnet\sdk]
5.0.202 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.All 2.1.24 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.27 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.24 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.27 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.14 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 1.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.27 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.14 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.11 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 3.1.14 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
This is my project file, additionally I found all location of System.Runtime.dll and include it path to project file.
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<RootNamespace>LinuxCamelCase</RootNamespace>
<TargetFramework>netcoreapp3.1</TargetFramework>
<ReferencePath>C:\Program Files\dotnet\sdk\3.1.408\;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.14;C:\Program Files\dotnet\sdk\3.1.408\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\;C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\3.1.0\ref\netcoreapp3.1</ReferencePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MySqlConnector" Version="1.3.8" />
</ItemGroup>
</Project>
However compilation in Visual Studio 2019 is impossible.
1>J:\Vs2019\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2123,5): warning MSB3246: Resolved file has a bad image, no metadata, or is otherwise inaccessible. Could not load file or assembly 'System.Runtime.Intrinsics.dll' or one of its dependencies. An attempt was made to load a program with an incorrect format.
1>J:\Vs2019\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2123,5): warning MSB3246: Resolved file has a bad image, no metadata, or is otherwise inaccessible. Could not load file or assembly 'System.Runtime.dll' or one of its dependencies. An attempt was made to load a program with an incorrect format.
1>vbc : error BC30002: Type 'System.Void' is not defined.
1>vbc : error BC30002: Type 'System.Void' is not defined.
1>vbc : error BC30002: Type 'System.String' is not defined.
1>vbc : error BC30002: Type 'System.String' is not defined.
1>vbc : error BC30002: Type 'System.Void' is not defined.
1>vbc : error BC30002: Type 'System.Object' is not defined.
1>vbc : error BC30002: Type 'System.Object' is not defined.
1>vbc : error BC30652: Reference required to assembly '<Missing Core Assembly>, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' containing the type 'Object'. Add one to your project.
1>vbc : error BC30652: Reference required to assembly '<Missing Core Assembly>, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' containing the type 'Object'. Add one to your project.
dotnet-core-uninstall
This tool cannot uninstall versions of the runtime or SDK that are
- SDKs installed using Visual Studio 2019 Update 3 or later.
- SDKs and runtimes installed via zip/scripts.
- Runtimes installed with SDKs (these should be removed by removing that SDK).
The versions that can be uninstalled with this tool are:
.NET Core SDKs:
5.0.202 x64 [Used by Visual Studio. Specify individually or use --force to remove]
5.0.104 x64
3.1.408 x86
3.1.408 x64
1.0.1 x64 [Used by Visual Studio. Specify individually or use --force to remove]
.NET Core Runtimes:
3.1.14 x64
2.1.27 x64
ASP.NET Core Runtimes:
5.0.5 x86
5.0.5 x64
3.1.14 x86
2.1.27 x64
.NET Core Runtime & Hosting Bundles:
Of course, I have selected .NET CORE development during VS2019 installation. But now I have only one option of compilation
<TargetFramework>net5.0</TargetFramework>
Compilation for other framefork is impossible. Why?
I DON'T want to move to NET 5.0 from NET 3.1 and DON'T want to support in my Linux hosting environment NET CORE 5.0, because I have a lot of historical application and I don't want a lot of different version of NET CORE in Linux hosting.
I hope this is only bug and not a Microsoft Policy - don't allow developers to save preferred version of NET CORE.