Install the SDK

winget install Microsoft.DotNet.SDK.7

Install the .NET Desktop Runtime

winget install Microsoft.DotNet.DesktopRuntime.7

Install the ASP.NET Core Runtime

winget install Microsoft.DotNet.AspNetCore.7

Install the .NET Runtime

winget install Microsoft.DotNet.Runtime.7

Build On Windows: Run on Ubuntu

<strong>Windows:</strong>
*******
dotnet new console -n test
The template "Console App" was created successfully.
cd test
-----------------
dotnet build
MSBuild version 17.5.0+6f08c67f3 for .NET
MSBUILD : error MSB1003: Specify a project or solution file. The current working directory does not contain a project or solution file.
-----------------

dotnet publish -c release -r ubuntu.16.04-x64 --self-contained
MSBuild version 17.5.0+6f08c67f3 for .NET
  Determining projects to restore...
  Restored E:\work\myDotNet\test\test.csproj (in 7.33 sec).
  test -> E:\work\myDotNet\test\bin\release\net7.0\ubuntu.20.04-x64\test.dll
  test -> E:\work\myDotNet\test\bin\release\net7.0\ubuntu.20.04-x64\publish\
----------------
Open Linux:
**********
cd ./obj/release/net7.0/ubuntu.20.04-x64/
./test
Hello, World!

This website stores cookies on your computer. These cookies are used to provide a more personalized experience and to track your whereabouts around our website in compliance with the European General Data Protection Regulation. If you decide to to opt-out of any future tracking, a cookie will be setup in your browser to remember this choice for one year.

Accept or Deny