diff --git a/compiled_starters/csharp/codecrafters-redis.csproj b/compiled_starters/csharp/codecrafters-redis.csproj index 3629673e..ee68fa94 100644 --- a/compiled_starters/csharp/codecrafters-redis.csproj +++ b/compiled_starters/csharp/codecrafters-redis.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net9.0 codecrafters_redis enable enable diff --git a/compiled_starters/csharp/codecrafters.yml b/compiled_starters/csharp/codecrafters.yml index 80bc2363..a8805bf6 100644 --- a/compiled_starters/csharp/codecrafters.yml +++ b/compiled_starters/csharp/codecrafters.yml @@ -7,5 +7,5 @@ debug: false # Use this to change the C# version used to run your code # on Codecrafters. # -# Available versions: dotnet-8.0 -language_pack: dotnet-8.0 +# Available versions: dotnet-9.0 +language_pack: dotnet-9.0 diff --git a/dockerfiles/dotnet-9.0.Dockerfile b/dockerfiles/dotnet-9.0.Dockerfile new file mode 100644 index 00000000..e2c77232 --- /dev/null +++ b/dockerfiles/dotnet-9.0.Dockerfile @@ -0,0 +1,20 @@ +# syntax=docker/dockerfile:1.7-labs +FROM mcr.microsoft.com/dotnet/sdk:9.0-alpine + +WORKDIR /app + +# .git & README.md are unique per-repository. We ignore them on first copy to prevent cache misses +COPY --exclude=.git --exclude=README.md . /app + +# This saves nuget packages to ~/.nuget +RUN dotnet build --configuration Release . + +# This seems to cause a caching issue with the dotnet build command, where old contents are used +# TODO: See if this needs to be brought back? +# RUN rm -rf /app/obj +# RUN rm -rf /app/bin + +RUN echo "cd \${CODECRAFTERS_REPOSITORY_DIR} && dotnet build --configuration Release ." > /codecrafters-precompile.sh +RUN chmod +x /codecrafters-precompile.sh + +ENV CODECRAFTERS_DEPENDENCY_FILE_PATHS="codecrafters-redis.csproj,codecrafters-redis.sln" diff --git a/solutions/csharp/01-jm1/code/codecrafters-redis.csproj b/solutions/csharp/01-jm1/code/codecrafters-redis.csproj index 3629673e..ee68fa94 100644 --- a/solutions/csharp/01-jm1/code/codecrafters-redis.csproj +++ b/solutions/csharp/01-jm1/code/codecrafters-redis.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net9.0 codecrafters_redis enable enable diff --git a/solutions/csharp/01-jm1/code/codecrafters.yml b/solutions/csharp/01-jm1/code/codecrafters.yml index 80bc2363..a8805bf6 100644 --- a/solutions/csharp/01-jm1/code/codecrafters.yml +++ b/solutions/csharp/01-jm1/code/codecrafters.yml @@ -7,5 +7,5 @@ debug: false # Use this to change the C# version used to run your code # on Codecrafters. # -# Available versions: dotnet-8.0 -language_pack: dotnet-8.0 +# Available versions: dotnet-9.0 +language_pack: dotnet-9.0 diff --git a/starter_templates/csharp/code/codecrafters-redis.csproj b/starter_templates/csharp/code/codecrafters-redis.csproj index 3629673e..ee68fa94 100644 --- a/starter_templates/csharp/code/codecrafters-redis.csproj +++ b/starter_templates/csharp/code/codecrafters-redis.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net9.0 codecrafters_redis enable enable