This repo holds all the codes of dotnet subject that I did in fifth semester BCA (TU)
This guide provides essential commands for working with .NET projects, including console and web applications.
dotnet new console -n MyApp # -n specifies the project name
cd MyAppdotnet runCompile the C# file (Windows only, requires .NET Framework):
csc Program.cs # Produces Program.exeRun the compiled executable:
./Program.exe # Windows
mono Program.exe # Linux/macOS (if using Mono)
⚠️ Note: csc (C# Compiler) is available only on Windows. On Linux/macOS, it's better to use dotnet projects.
- Restore dependencies (equivalent to npm install):
dotnet restore- Run the project:
dotnet rundotnet run --project MyWebApp # Replace 'MyWebApp' with your project folderApply migrations (Entity Framework Core):
dotnet ef database update # Similar to 'npx prisma migrate dev'dotnet build # Compiles the project
```re)
### Version Management
```sh
dotnet --version # Check SDK version
dotnet --list-sdks # List installed SDKs
dotnet --list-runtimes # List installed runtimes
```ands
lding a .NET Project
### Creating Web Applications
```sh
dotnet new web -n MyWebApp
cd MyWebAppcking Installed .NET SDK Version
dotnet rundotnet add package MySql.Data
| Node.js Command | .NET Equivalent | |----------------|-----------------|web -n MyWebApp | npm install | dotnet restore |p | npm run dev | dotnet run | | npm start | dotnet run |ting Installed .NET SDKs | npx prisma migrate dev | dotnet ef database update |