Skip to content

Commit

Permalink
Merge pull request #283 from codecrafters-io/CC-1541
Browse files Browse the repository at this point in the history
CC-1541: Update .NET version to 9.0
  • Loading branch information
ryan-gang authored Dec 12, 2024
2 parents 47c9e38 + ec0c4cf commit d92c0c5
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 7 deletions.
2 changes: 1 addition & 1 deletion compiled_starters/csharp/codecrafters-redis.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<RootNamespace>codecrafters_redis</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
Expand Down
4 changes: 2 additions & 2 deletions compiled_starters/csharp/codecrafters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
20 changes: 20 additions & 0 deletions dockerfiles/dotnet-9.0.Dockerfile
Original file line number Diff line number Diff line change
@@ -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"
2 changes: 1 addition & 1 deletion solutions/csharp/01-jm1/code/codecrafters-redis.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<RootNamespace>codecrafters_redis</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
Expand Down
4 changes: 2 additions & 2 deletions solutions/csharp/01-jm1/code/codecrafters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion starter_templates/csharp/code/codecrafters-redis.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<RootNamespace>codecrafters_redis</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
Expand Down

0 comments on commit d92c0c5

Please sign in to comment.