Skip to main content
stevedunn / stringlytyped
About Waitlist Learn Search Enterprise
Search
Login Sign Up
Logo
Main Menu Project Homepage Learn Codebase Developer Dashboards Contribute Extensions Help
  • Learn Codebase
  • Learn API
  • Learn SDK
  • Environment Setup
  • Knowledge Base
  • Chat to Codebase
  • Search
Logo Shoulder Homepage
Project Homepage
Learn Codebase
Developer Dashboards
Contribute
Extensions
Help
  • Development
  • Setup
  • Docker Configuration
  • Start & Build
  • Run Tests
  • Configuration
  • Common Issues
  • CI/CD
  • Workflow
  • Automation scripts
  • Deploy
  • Production
  • Deployment
  • Secret Management
  • Monitoring & Logging
  • Scaling & Performance
  • Contributor Dashboards
Cloud Setup Windows Setup MacOS Setup Linux Setup Docker Setup VS Code

Installing DotNet Development Environment on Windows

This guide provides step-by-step instructions to set up the .NET development environment on a Windows operating system.


Step 1: Download the .NET SDK Installer

  1. Open a web browser and navigate to the official .NET download page.
  2. Select the version of .NET you want to install (e.g., .NET 7 or .NET 6 LTS).
  3. Click on the Download .NET SDK button for Windows.

Step 2: Install the .NET SDK

  1. Locate the downloaded .exe installer file in your Downloads folder.
  2. Double-click the installer to launch the installation wizard.
  3. Follow the prompts:
  • Accept the license agreement.
  • Choose installation options (default options are usually sufficient).
  1. Click Install to begin the installation process.
  2. Wait for the installer to complete and click Finish.

Step 3: Verify Installation

  1. Open a Command Prompt or PowerShell window.
  2. Type the following command to check if .NET is installed:
dotnet --version

You should see the installed version number (e.g., 7.0.x).


Step 4: Create a Sample .NET Project

  1. Open a Command Prompt or PowerShell window.
  2. Create a new project by running:
dotnet new console -o MyFirstApp
  1. Navigate to the project folder:
cd MyFirstApp
  1. Run the application:
dotnet run

You should see output like Hello, World!.


Troubleshooting Tips

  • Problem: dotnet command not recognized.
  • Solution: Ensure the .NET SDK is added to your system PATH. Restart your computer if necessary.
  • Problem: Installation fails due to missing dependencies.
  • Solution: Install the latest Windows updates and retry.

Congratulations! You have successfully set up the .NET development environment on your Windows machine. You are now ready to start building .NET applications!

Installing DotNet Development Environment on macOS

This guide provides step-by-step instructions to set up the .NET 9.0 development environment on macOS.


Step 1: Download the .NET SDK Installer

  1. Open a web browser and navigate to the .NET 9.0 download page.
  2. Under the SDK section, select the macOS installer (.pkg) that matches your macOS version.
  3. Click the Download button to start the download.

Step 2: Install the .NET SDK

  1. Locate the downloaded .pkg file in your Downloads folder.
  2. Double-click the .pkg file to launch the installer.
  3. Follow the on-screen instructions:
  • Read and agree to the license agreement.
  • Confirm the installation location (default location is recommended).
  1. Click Install and enter your macOS administrator password when prompted.
  2. Wait for the installation to complete, and then click Close.

Step 3: Verify Installation

  1. Open the Terminal application.
  2. Run the following command to verify the installation:
dotnet --version

You should see the installed version number (e.g., 9.0.x).


Step 4: Create a Sample .NET Project

  1. Open the Terminal.
  2. Create a new project by running:
dotnet new console -o MyFirstApp
  1. Navigate to the project folder:
cd MyFirstApp
  1. Run the application:
dotnet run

You should see output like Hello, World!.


Step 5: Update the Path (If Necessary)

If the dotnet command is not recognized, you may need to add the .NET tools to your PATH manually:

  1. Open the Terminal.
  2. Locate the .NET installation path:
/usr/local/share/dotnet
  1. Add the path to your shell configuration file:
  • If using zsh (default shell for macOS), edit ~/.zshrc:
nano ~/.zshrc
  • Add the following line:
export PATH="$PATH:/usr/local/share/dotnet"
  1. Save the file and reload the shell configuration:
source ~/.zshrc
  1. Verify the dotnet command again:
dotnet --version

Troubleshooting Tips

1. dotnet Command Not Recognized

  • Solution: Ensure the .NET SDK is added to your PATH. Refer to Step 5 above to manually configure your PATH.

2. Installation Fails with “Unsupported macOS Version”

  • Solution: Verify that your macOS version is compatible with .NET 9.0. Update macOS to the latest version if necessary.

3. Permissions Issues During Installation

  • Solution: Ensure you have administrator privileges. If the problem persists, try running the installer from the Terminal with elevated privileges:
sudo installer -pkg path/to/installer.pkg -target /

4. Cannot Run Applications Due to Missing Dependencies

  • Solution: Ensure that all macOS updates are installed. Run:
softwareupdate --install --all

5. .NET Project Build Errors

  • Solution: Clear the NuGet cache and restore packages:
dotnet nuget locals all --clear
dotnet restore

Congratulations! You have successfully installed the .NET 9.0 development environment on your macOS. You can now start building .NET applications.

Installing DotNet Development Environment on Linux

This guide provides step-by-step instructions to set up the .NET 9.0 development environment on a Linux operating system.


Step 1: Choose Your Linux Distribution

Before starting, identify your Linux distribution. This guide includes steps for the following popular distributions:

  • Ubuntu/Debian
  • Fedora
  • CentOS/RHEL

For other distributions, refer to the official .NET documentation.


Step 2: Install the .NET SDK

For Ubuntu/Debian

  1. Update the Package Index:
sudo apt update
  1. Install Required Dependencies:
sudo apt install -y wget apt-transport-https
  1. Add Microsoft’s Package Repository:
wget https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
  1. Install the .NET SDK:
sudo apt update
sudo apt install -y dotnet-sdk-9.0

For Fedora

  1. Add Microsoft’s Package Repository:
sudo dnf install -y dotnet-sdk-9.0

For CentOS/RHEL

  1. Add Microsoft’s Package Repository:
sudo dnf install dotnet-sdk-9.0

Step 3: Verify Installation

  1. Open a Terminal.
  2. Check the installed .NET version:
dotnet --version

You should see the installed version, e.g., 9.0.x.


Step 4: Create a Sample .NET Project

  1. Open a Terminal.
  2. Create a new project:
dotnet new console -o MyFirstApp
  1. Navigate to the project folder:
cd MyFirstApp
  1. Run the application:
dotnet run

You should see the output: Hello, World!.


Troubleshooting Tips

1. dotnet Command Not Found

  • Solution: Ensure the .NET SDK is installed and added to your PATH.
  • For Ubuntu/Debian: Verify with sudo apt install dotnet-sdk-9.0.
  • For Fedora/CentOS: Verify with sudo dnf install dotnet-sdk-9.0.

2. Compatibility Issues with Older Linux Versions

  • Solution: Ensure your Linux distribution is updated to a supported version. Check .NET 9.0 system requirements in the official documentation.

3. Package Repository Errors

  • Solution: Clear package cache and try again:
  • For Ubuntu/Debian: sudo apt update --fix-missing.
  • For Fedora/CentOS: sudo dnf clean all.

4. Cannot Build or Run .NET Applications

  • Solution: Restore NuGet packages:
dotnet restore

5. Missing Dependencies

  • Solution: Install essential libraries:
  • Ubuntu/Debian:
sudo apt install -y libssl-dev libcurl4-openssl-dev zlib1g
  • Fedora/CentOS:
sudo dnf install -y openssl-devel libcurl-devel zlib

Congratulations! You have successfully set up the .NET 9.0 development environment on Linux. You are now ready to start building .NET applications.

Installing DotNet Development Environment on Docker

This guide provides step-by-step instructions to set up the .NET 9.0 development environment using Docker.


Prerequisites

Ensure you have the following installed:

  • Docker (latest version). If not installed, refer to the Docker installation guide.

Step 1: Pull the Official .NET Docker Image

  1. Open a terminal.
  2. Pull the official .NET 9.0 SDK Docker image from Docker Hub:
docker pull mcr.microsoft.com/dotnet/sdk:9.0

This image contains the .NET 9.0 SDK and runtime.


Step 2: Verify the Image is Downloaded

  1. List all Docker images to confirm the .NET SDK image is available:
docker images

You should see an entry like this:

REPOSITORY                  TAG       IMAGE ID       CREATED        SIZE
mcr.microsoft.com/dotnet/sdk  9.0     <image_id>     <timestamp>    <size>

Step 3: Create and Run a Container

  1. Create and run a Docker container interactively:
docker run -it --name dotnet-dev mcr.microsoft.com/dotnet/sdk:9.0
  1. You will now be inside the container’s shell. Verify the .NET version:
dotnet --version

It should display 9.0.x.


Step 4: Develop Inside the Container

Option 1: Create a New .NET Project

  1. Inside the container, create a new .NET project:
dotnet new console -o MyFirstApp
  1. Navigate to the project directory:
cd MyFirstApp
  1. Run the application:
dotnet run

You should see the output: Hello, World!.


Option 2: Mount a Local Directory

To work on projects stored on your host machine:

  1. Stop the container if it’s running:
docker stop dotnet-dev
  1. Restart the container, mounting your local directory (e.g., /path/to/code) to the container:
docker run -it --rm -v /path/to/code:/app --workdir /app mcr.microsoft.com/dotnet/sdk:9.0
  1. Inside the container, navigate to your project and build or run it:
dotnet restore
dotnet run

Step 5: Cleanup

To remove the container and image when no longer needed:

  1. Stop the container:
docker stop dotnet-dev
  1. Remove the container:
docker rm dotnet-dev
  1. Remove the image:
docker rmi mcr.microsoft.com/dotnet/sdk:9.0

Troubleshooting Tips

1. docker: command not found

  • Solution: Ensure Docker is installed and running. Check the Docker installation guide.

2. Cannot Pull the Image

  • Solution: Verify your internet connection and Docker Hub access. Use the --platform flag if running on ARM-based systems (e.g., Apple Silicon):
docker pull --platform linux/arm64 mcr.microsoft.com/dotnet/sdk:9.0

3. Permission Denied Errors

  • Solution: Ensure your user has permission to run Docker commands. Add your user to the docker group:
sudo usermod -aG docker $USER

Log out and back in, then retry.

4. Code Changes Not Reflected

  • Solution: If using a mounted volume, ensure you save changes to your local files before running the application.

5. Issues with File Permissions

  • Solution: Set appropriate permissions on mounted files and directories to ensure the container can access them.

Congratulations! You have successfully set up a .NET 9.0 development environment using Docker. You can now build, run, and test your .NET applications in an isolated containerized environment.

VS Code Environment

When using VS Code we recommend installing the following extensions:

C#

C# language support for Visual Studio Code.

 screenshot

C# Dev Kit

C# Dev Kit helps you manage your code with a solution explorer and test your code with integrated unit test discovery and execution, elevating your C# development experience wherever you like to develop.

 screenshot

Docker

Makes it easy to create, manage, and debug containerized applications.

 screenshot

CLI Tooling

The tooling CLI tooling would be beneficial to have setup:

More details coming soon

Cloud based Development Environments

There are currently no cloud-based development environments pre-configured for this project. Use the links below to quickly launch a new environment.

Gitpod

Open in Gitpod

GitHub Codespaces

Open in GitHub Codespaces

VS Code

Open in VS Code (Web)
Shoulder.dev can make mistakes.Consider checking important information.