> For the complete documentation index, see [llms.txt](https://docs.h4rithd.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.h4rithd.com/languages/.net.md).

# .Net

## 01. C\#

* Basic

{% code title="filename.cs" %}

```csharp
using System;

namespace h4rithd
{
    class welcome
    {
        static void Main(string[] args)
        {
            Console.WriteLine("welcome to h4rithd.com\r\n");
        }
    }
}
```

{% endcode %}

* Complie

```bash
## ------------------| Choose version
dir dir c:\Windows\Microsoft.NET\Framework64\v*
dir c:\Windows\Microsoft.NET\Framework\v*

## ------------------| Complie
c:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc.exe filename.cs 
dir ! find "filename.exe"
.\filename.exe
```

* Debug

<pre class="language-csharp"><code class="lang-csharp">## ------------------| Debug comments
using System.Diagnostics;
static void Main(string[] args)
<strong>{
</strong>    Debug.Print("Debug");
}

## ------------------| Console output
Console.WriteLine("Debug");
System.Console.WriteLine("Debug");

## ------------------| Message Box
MessageBox.Show("message", "title");  
</code></pre>

## 02. DotNet Core

### 02.1 [Getting Started](https://dotnet.microsoft.com/en-us/download/visual-studio-sdks)

```bash
## ------------------| Installation on KaliLinux
wget https://packages.microsoft.com/config/debian/12/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb
sudo apt-get update
sudo apt-get install -y dotnet-sdk-X.0 ### change the X value as 4,5,6,7,8,9...
sudo apt-get install -y dotnet-runtime-X.0 ### change the X value as 4,5,6,7,8,9...
sudo apt-get install -y aspnetcore-runtime-X.0 ### change the X value as 4,5,6,7,8,9...
```

### 02.2 Create Applications

#### [CLI Application](https://learn.microsoft.com/en-us/dotnet/core/get-started)

```bash
## ------------------| Create project
dotnet new console -o cliapp

## ------------------| Run the appllication
cd cliapp
dotnet run

## ------------------| Build
dotnet build -c release
dotnet build -c debug
```

#### [ASP.NET Core](https://learn.microsoft.com/en-us/aspnet/core/getting-started/?view=aspnetcore-6.0)

```bash
## ------------------| Create project
dotnet new webapp --output aspnetcoreapp --no-https

## ------------------| Run the appllication
cd aspnetcoreapp
dotnet run

## ------------------| Build
dotnet build -c release
dotnet build -c debug
```

#### DLL Application

```bash
## ------------------| Create project
dotnet new classlib -n dllapp

## ------------------| Add Packages
dotnet add package Microsoft.AspNetCore.Components --version 6.0.0
dotnet add package Microsoft.AspNetCore.Components.Web --version 6.0.0

## ------------------| Build
dotnet build -c release
dotnet build -c debug
```
