Skip to main content

Command Palette

Search for a command to run...

DotNet Core App 8

Published
1 min read
M

Mohamad's interest is in Programming (Mobile, Web, Database and Machine Learning). He is studying at the Center For Artificial Intelligence Technology (CAIT), Universiti Kebangsaan Malaysia (UKM).

[1] Create C# Project in Replit

refer https://hashnotes.hashnode.dev/dotnet-core-app

[2] Update basic files

[2.1] .replit files

entrypoint = "main.cs"
hidden = ["bin", "obj"]
modules = ["dotnet-8.0"]

[env]
DOTNET_NOLOGO = "1"
DOTNET_CLI_TELEMETRY_OPTOUT = "1"
DOTNET_CLI_HOME = "$XDG_CACHE_HOME"

[gitHubImport]
requiredFiles = [".replit", "replit.nix"]

[nix]
channel = "stable-24_05"

[deployment]
run = ["dotnet", "run"]
deploymentTarget = "cloudrun"

[2.2] main.csproj file

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net8.0</TargetFramework>
    <StartupObject>Program</StartupObject>
  </PropertyGroup>

</Project>

[2.3] main.cs file

using System;

class Program {
  public static void Main (string[] args) {
    Console.WriteLine ("Hello World");
  }
}

Preview