This project demonstrates one possible way to setup and organize your Visual Studio project. As this project progresses it will be broken apart into various layers that can be consumed by one of the example project applications provided.
You can find my ePortfolio here.
The project is broken apart into the following examples:
- Api.Startup.Example - This sample application is provided as a demonstration for creating a RESTful API using ASP.NET Core.
- Startup.Blazor.Server - This sample application is provided as a demonstration for creating a Blazor application using ASP.NET Core.
- Console.Startup.Example - This sample application is provided as a demonstration for creating a Windows service application using ASP.NET Core.
- Database.Example - This sample application is provided as a demonstration for creating a database using Database First.
- React.Startup.Example - ToDo
- Startup.Web - This sample application is provided as a demonstration for creating a web application using ASP.NET Core.
- .NET 8.0
- Visual Studio 2022
- SQL Server Express 2019 or later
- SQL Server Management Studio or other SQL Server management tool
- Docker Desktop
- Clone the repository to your local machine.
- Locate the file docker_setup.ps1 in the root of the project and run this in PowerShell which will setup the Docker Containers and Dependencies.
- To get started with this project, you will need to clone the repository and then open the solution in Visual Studio.
- Once the solution is open, you will want to build the solution. This will download all of the NuGet packages that are required or the project.
- Open the Database.Example project and build the project then publish using the "StartupExample.publish.xml" profile.
- There should be no need to update the secrets.json file with the connection string as it should be configured in the appsettings.json file for SQL Express.
- Start Visual Studio and open the solution.
- Open the Database.Example project and build the project then publish using the "StartupExample.Docker.publish.xml" profile. Using the default password of "P@ssword123!".
- MailHog was added as an email trap.
- Open Telemetry was added to the project to help with debugging and development and can be found here after starting the docker containers.
- Watch the following video for why and how its used: The Logging Everyone Should Be Using in .NET
- Once the project has been built and the database has been created, you can run any of the applications.
If you are using CodeSpaces you'll want to update your container git configuration profile. Be sure to update with your appropriate name and email details.
git config --global user.name "Your Name"
git config --global user.email "youremail@yourdomain.com"