Skip to content

Commit c2f1a5c

Browse files
authored
Merge pull request #110 from codecrafters-io/CC-1541
CC-1541: Update .NET version to 9.0
2 parents 2b64ed9 + a8796f1 commit c2f1a5c

File tree

9 files changed

+34
-10
lines changed

9 files changed

+34
-10
lines changed

compiled_starters/csharp/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Time to move on to the next stage!
3131

3232
Note: This section is for stages 2 and beyond.
3333

34-
1. Ensure you have `dotnet (8.0)` installed locally
34+
1. Ensure you have `dotnet (9.0)` installed locally
3535
1. Run `./your_program.sh` to run your program, which is implemented in
3636
`src/Program.cs`.
3737
1. Commit your changes and run `git push origin master` to submit your solution

compiled_starters/csharp/codecrafters-grep.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net8.0</TargetFramework>
5+
<TargetFramework>net9.0</TargetFramework>
66
<RootNamespace>codecrafters_grep</RootNamespace>
77
<ImplicitUsings>enable</ImplicitUsings>
88
<Nullable>enable</Nullable>

compiled_starters/csharp/codecrafters.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ debug: false
77
# Use this to change the C# version used to run your code
88
# on Codecrafters.
99
#
10-
# Available versions: dotnet-8.0
11-
language_pack: dotnet-8.0
10+
# Available versions: dotnet-9.0
11+
language_pack: dotnet-9.0

dockerfiles/dotnet-9.0.Dockerfile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
FROM mcr.microsoft.com/dotnet/sdk:9.0-alpine
2+
3+
COPY codecrafters-grep.csproj /app/codecrafters-grep.csproj
4+
COPY codecrafters-grep.sln /app/codecrafters-grep.sln
5+
6+
RUN mkdir /app/src
7+
RUN (echo 'System.Console.WriteLine("If you are seeing this, there is something wrong with our caching mechanism! Please contact us at [email protected].");' > /app/src/Program.cs) > /dev/null
8+
9+
WORKDIR /app
10+
11+
# This saves nuget packages to ~/.nuget
12+
RUN dotnet build --configuration Release .
13+
14+
# Overwrite Program.cs to remove the echoed line
15+
RUN rm /app/src/Program.cs
16+
17+
# This seems to cause a caching issue with the dotnet build command, where contents from the removed /src/Program.cs are used
18+
RUN rm -rf /app/obj
19+
RUN rm -rf /app/bin
20+
21+
RUN echo "cd \${CODECRAFTERS_REPOSITORY_DIR} && dotnet build --configuration Release ." > /codecrafters-precompile.sh
22+
RUN chmod +x /codecrafters-precompile.sh
23+
24+
ENV CODECRAFTERS_DEPENDENCY_FILE_PATHS="codecrafters-grep.csproj,codecrafters-grep.sln"

solutions/csharp/01-cq2/code/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Time to move on to the next stage!
3131

3232
Note: This section is for stages 2 and beyond.
3333

34-
1. Ensure you have `dotnet (8.0)` installed locally
34+
1. Ensure you have `dotnet (9.0)` installed locally
3535
1. Run `./your_program.sh` to run your program, which is implemented in
3636
`src/Program.cs`.
3737
1. Commit your changes and run `git push origin master` to submit your solution

solutions/csharp/01-cq2/code/codecrafters-grep.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net8.0</TargetFramework>
5+
<TargetFramework>net9.0</TargetFramework>
66
<RootNamespace>codecrafters_grep</RootNamespace>
77
<ImplicitUsings>enable</ImplicitUsings>
88
<Nullable>enable</Nullable>

solutions/csharp/01-cq2/code/codecrafters.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ debug: false
77
# Use this to change the C# version used to run your code
88
# on Codecrafters.
99
#
10-
# Available versions: dotnet-8.0
11-
language_pack: dotnet-8.0
10+
# Available versions: dotnet-9.0
11+
language_pack: dotnet-9.0

starter_templates/csharp/code/codecrafters-grep.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net8.0</TargetFramework>
5+
<TargetFramework>net9.0</TargetFramework>
66
<RootNamespace>codecrafters_grep</RootNamespace>
77
<ImplicitUsings>enable</ImplicitUsings>
88
<Nullable>enable</Nullable>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
attributes:
2-
required_executable: dotnet (8.0)
2+
required_executable: dotnet (9.0)
33
user_editable_file: src/Program.cs

0 commit comments

Comments
 (0)