question

FrankNatoli-2507 avatar image
0 Votes"
FrankNatoli-2507 asked lextm edited

How to update Visual Studio with C# .NET Core for Linux dotnet

Attempting to use Visual Studio 2017 on Windows to generate .NET Core DLL for use on Linux Centos8.
Have installed dotnet on Linux Centos8.
Have compiled HelloWorld C# .NET Core DLL on Windows.
Downloaded DLL to Linux Centos8.
Run "dotnet HelloWorld.dll".
Am advised of framework mismatch.
Linux Centos8 has v3.0.3 and v3.1.11.
Visual Studio is compiling for v2.1.
On Visual Studio "target framework", see dropdown of 1.0, 1.1, 2.0, 2.1 and "install other frameworks...".
Click on "install other frameworks".
Am transferred to this webpage:
https://dotnet.microsoft.com/download/visual-studio-sdks?utm_source=getdotnetsdk&utm_medium=referral
Click on ".NET Core 3.1", "x64 SDK", download EXE and run EXE.
Restart Visual Studio, even reboot Windows, do not see any new frameworks, still limited to 1.0, 1.1, 2.0 and 2.1.
How to get Visual Studio to produce code with framework available on my Linux Centos8?
Thanks.

dotnet-csharpdotnet-ad
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

lextm avatar image
1 Vote"
lextm answered lextm edited

sudo dnf install dotnet-runtime-2.1 gives you the necessary runtime to run .NET Core 2.1 apps on Linux.

If you want to develop .NET Core 3.1 or .NET 5 apps on Windows, VS2019 is necessary (or you can use VSCode as last resort).

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.