- Visual Studio (Windows)
- Visual Studio for Mac (MacOS)
- Visual Studio Code (Windows/MacOS/Linux)
-
Install .NET Core
-
Install SQL Server
-
Install Docker
-
Set user secrets, if you want to run the application outside docker for debugging and other scenarios
$ cd <repo_path>/UrlShortener/src/UrlShortener
$ dotnet user-secrets set 'HttpClient:Github:Token' '<Token>'
$ dotnet user-secrets set "ConnectionStrings:Database" "<Database_Connection_String>"
$ dotnet user-secrets set "Seq:ApiKey" "<Api_Key>"
$ dotnet user-secrets set "LaunchDarkly:SdkKey" "<SdkKey>"
- Install Visual Studio
- Open Solution file
- Install VS Code.
- Install C# extension (
ms-vscode.csharp
) in VS Code. - Open the folder containing the .sln file
- Install Seq
- After installing browse at default url http://localhost:5341/
- Create your [LaunchDarkly][https://app.launchdarkly.com] account
- Create Feature Flag
$ cd <repo_path>/UrlShortener
$ dotnet run --project .\src\UrlShortener\UrlShortener.csproj --environment "Development" --launch-profile https
- Set environment variables in docker-compose file
environment:
- ConnectionStrings__Database=<Database_Connection_String>
- HttpClient__Github__Token=<Token>
$ cd <repo_path>/UrlShortener
$ docker-compose up
# if changes have been made, you will need to build them before running docker-compose up:
$ docker-compose build
# Command to build
$ docker build --rm -t iamrks/urls:latest .
# Command to run
$ docker run -p 5000:8080 iamrks/urls
# To run in background
$ docker run -d -p 5000:8080 iamrks/urls
# To Stop
$ docker ps
$ docker stop <container_id>
# To list docker images
$ docker images
# To remove a image
$ docker rmi iamrks/urls --force
- Add .Net Aspire Service Default Project to solution
- Then add reference and update Program.cs
- Check Commit