C# (C-Sharp) Advent of Code solutions
Tasks solutions:
Year | Stars |
---|---|
2015 | 50 ![]() |
2016 | 50 ![]() |
2017 | 50 ![]() |
2018 | 50 ![]() |
2019 | 50 ![]() |
2020 | 50 ![]() |
2021 | 50 ![]() |
2022 | 12 ![]() |
Prerequisites for running project
Copy ./src/.env.example
to ./src/.env
file and set year, day and part for task you wish to debug or run.
Local development:
Run watcher, runs source code on file change:
dotnet watch --project ./src/AdventOfCode.csproj run
Run source code:
dotnet run --project ./src/AdventOfCode.csproj
Docker development:
Run watcher, run source code on file change:
- Build and compose project
or
docker-compose -f docker-compose.yml -f docker-compose.watch.yml build \ --build-arg USER_NAME=$(whoami) --build-arg USER_ID=$(id -u) --build-arg GROUP_ID=$(id -g) docker-compose -f docker-compose.yml -f docker-compose.watch.yml up -d --force-recreate
docker-compose -f docker-compose.yml -f docker-compose.watch.yml up -d --force-recreate --build
- Get a bash shell in the app running container:
docker-compose exec app /bin/bash
- Run watcher:
dotnet watch run
Debug configuration:
- Build and compose project
docker-compose -f docker-compose.yml -f docker-compose.debug.yml up -d --force-recreate --build
- Get a bash shell in the app running container:
docker-compose exec app /bin/bash
- Run assembly:
dotnet run
Release configuration:
- Build and compose project
docker-compose up -d --force-recreate --build
- Get a bash shell in the app running container:
docker-compose exec app /bin/bash
- Run assembly:
dotnet AdventOfCode.dll
Check app container logs:
docker-compose logs -ft app