10-Day .Net Aspire Challenge: Day 1 - An Introduction to .Net Aspire

Written by ssukhpinder | Published 2024/08/29
Tech Story Tags: dotnet | csharp | cloud | application | dotnet-aspire | dotnet-core | cloud-native | software-development

TLDRStep-by-step guide on how to use theĀ .Net Aspire framework in Visual Studio. The framework is used to develop cloud and production-ready distributed applications. It consists of components to handle cloud-native concerns such as Redis, Postgres etc.via the TL;DR App

Step-by-step guide on how to use theĀ .Net Aspire framework in Visual Studio.

Introduction

.Net Aspire framework is used to develop cloud and production-ready distributed applications. It consists of components to handle cloud-native concerns such as Redis, Postgres, etc.

Prerequisites

Objectives

  • Learn how to create a starter project usingĀ .Net Aspire templates.

Getting Started

Step 1: Open VisualĀ Studio

Open Visual Studio, and then select ā€œ.Net Aspire Starter Appā€ as shown below.

Step 2: Provide the ProjectĀ Name

Provide the project name and project directory.


Step 3: Select Frameworks

The next step is to select the applicable frameworks, and check ā€œConfigure for httpsā€.

Note: Select ā€œUse Redis for cachingā€ only if the docker container is up and running.


And finally, click the ā€œCreateā€ button at the bottom.

Step 4: Understand the Solution Structure

The solution consists of 4 different projects as follows [If a test project is selected then an additional test project will be available]

  • DotnetAspireChallenge.ApiService: An ASP.Net Web API project is used to provide data for the web application.
  • DotnetAspireChallenge.AppHost: An orchestrator project to connect and configure multiple projects and services.
  • DotnetAspireChallenge.ServiceDefaults: A shared configuration manager for all of your projects and services.
  • DotnetAspireChallenge.Web: A blazer web application that connects with ā€œDotnetAspireChallenge.ApiServiceā€ to fetch data.


Step 5: Run theĀ Project

Set ā€œDotnetAspireChallenge.AppHostā€ as the startup project, and run the project as shown below.



Congratulations..!! You’ve created your firstĀ .Net Aspire project.

Github Project

GitHub - ssukhpinder/DotnetAspireChallenge: 10 DayĀ .Net Aspire Challenge

C# ProgrammingšŸš€

Thank you for being a part of the C# community! Before you leave:

Follow us: Youtube | X | LinkedIn | Dev.to

Visit our other platforms: GitHub More content at C# Programming


Written by ssukhpinder | Programmer by heart | C# | Python | .Net Core | Xamarin | Angular | AWS
Published by HackerNoon on 2024/08/29