Skip to content

Commit

Permalink
Update dotnet version
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastienros committed Oct 29, 2024
1 parent 7aca29c commit d0d8aa3
Show file tree
Hide file tree
Showing 13 changed files with 42 additions and 33 deletions.
2 changes: 1 addition & 1 deletion frameworks/CSharp/aspnetcore/appsettings.postgresql.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"ConnectionString": "Server=tfb-database;Database=hello_world;User Id=benchmarkdbuser;Password=benchmarkdbpass;SSL Mode=Disable;Maximum Pool Size=18;NoResetOnClose=true;Enlist=false;Max Auto Prepare=4;Multiplexing=true;Write Coalescing Buffer Threshold Bytes=1000",
"ConnectionString": "Server=tfb-database;Database=hello_world;User Id=benchmarkdbuser;Password=benchmarkdbpass;SSL Mode=Disable;Maximum Pool Size=512;NoResetOnClose=true;Enlist=false;Max Auto Prepare=4",
"Database": "postgresql"
}
6 changes: 3 additions & 3 deletions frameworks/CSharp/aspnetcore/aspnetcore-aot.dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
RUN apt-get update
RUN apt-get -yqq install clang zlib1g-dev
WORKDIR /app
COPY src/Platform .
RUN dotnet publish -c Release -o out /p:DatabaseProvider=Npgsql /p:PublishAot=true /p:OptimizationPreference=Speed /p:GarbageCollectionAdaptationMode=0

FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS runtime
ENV URLS http://+:8080
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS runtime
ENV URLS=http://+:8080

WORKDIR /app
COPY --from=build /app/out ./
Expand Down
7 changes: 5 additions & 2 deletions frameworks/CSharp/aspnetcore/aspnetcore-minimal.dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
WORKDIR /app
COPY src/Minimal .
RUN dotnet publish -c Release -o out

FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS runtime
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS runtime
ENV URLS http://+:8080
ENV DOTNET_GCDynamicAdaptationMode=0
ENV DOTNET_ReadyToRun=0
ENV DOTNET_HillClimbing_Disable=1

WORKDIR /app
COPY --from=build /app/out ./
Expand Down
7 changes: 5 additions & 2 deletions frameworks/CSharp/aspnetcore/aspnetcore-mvc.dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
WORKDIR /app
COPY src/Mvc .
RUN dotnet publish -c Release -o out

FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS runtime
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS runtime
ENV URLS http://+:8080
ENV DOTNET_GCDynamicAdaptationMode=0
ENV DOTNET_ReadyToRun=0
ENV DOTNET_HillClimbing_Disable=1

WORKDIR /app
COPY --from=build /app/out ./
Expand Down
7 changes: 5 additions & 2 deletions frameworks/CSharp/aspnetcore/aspnetcore-mysql.dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
WORKDIR /app
COPY src/Platform .
RUN dotnet publish -c Release -o out /p:DatabaseProvider=MySqlConnector

FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS runtime
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS runtime
ENV URLS http://+:8080
ENV DOTNET_GCDynamicAdaptationMode=0
ENV DOTNET_ReadyToRun=0
ENV DOTNET_HillClimbing_Disable=1

WORKDIR /app
COPY --from=build /app/out ./
Expand Down
9 changes: 6 additions & 3 deletions frameworks/CSharp/aspnetcore/aspnetcore.dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
WORKDIR /app
COPY src/Platform .
RUN dotnet publish -c Release -o out /p:DatabaseProvider=Npgsql

FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS runtime
ENV URLS http://+:8080
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS runtime
ENV URLS=http://+:8080
ENV DOTNET_GCDynamicAdaptationMode=0
ENV DOTNET_ReadyToRun=0
ENV DOTNET_HillClimbing_Disable=1

WORKDIR /app
COPY --from=build /app/out ./
Expand Down
8 changes: 4 additions & 4 deletions frameworks/CSharp/aspnetcore/src/Minimal/Minimal.csproj
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<LangVersion>latest</LangVersion>
<UserSecretsId>38063504-d08c-495a-89c9-daaad2f60f31</UserSecretsId>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Npgsql" Version="8.0.3" />
<PackageReference Include="Dapper" Version="2.1.21" />
<PackageReference Include="RazorSlices" Version="0.7.0" />
<PackageReference Include="Npgsql" Version="8.0.5" />
<PackageReference Include="Dapper" Version="2.1.35" />
<PackageReference Include="RazorSlices" Version="0.8.1" />
</ItemGroup>

</Project>
14 changes: 6 additions & 8 deletions frameworks/CSharp/aspnetcore/src/Minimal/Program.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System.Text.Encodings.Web;
using System.Text.Unicode;
using Microsoft.AspNetCore.Http.HttpResults;
using RazorSlices;
using Minimal;
using Minimal.Database;
using Minimal.Models;
using System.Text.Encodings.Web;
using System.Text.Unicode;

var builder = WebApplication.CreateBuilder(args);

Expand Down Expand Up @@ -36,14 +34,14 @@

app.MapGet("/db", async (Db db) => await db.LoadSingleQueryRow());

var createFortunesTemplate = RazorSlice.ResolveSliceFactory<List<Fortune>>("/Templates/Fortunes.cshtml");
var htmlEncoder = CreateHtmlEncoder();

app.MapGet("/fortunes", async (HttpContext context, Db db) => {
var fortunes = await db.LoadFortunesRows();
var template = (RazorSliceHttpResult<List<Fortune>>)createFortunesTemplate(fortunes);
template.HtmlEncoder = htmlEncoder;
return template;
var result = Results.Extensions.RazorSlice<Minimal.Slices.Fortunes, List<Fortune>>(fortunes);
result.HtmlEncoder = htmlEncoder;

return result;
});

app.MapGet("/queries/{count?}", async (Db db, string? count) => await db.LoadMultipleQueriesRows(count));
Expand Down
6 changes: 3 additions & 3 deletions frameworks/CSharp/aspnetcore/src/Mvc/Mvc.csproj
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<LangVersion>latest</LangVersion>
<UserSecretsId>574ff97c-fe74-4b0d-af25-8d7200a036f5</UserSecretsId>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Npgsql" Version="8.0.3" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.0-rc.2" />
<PackageReference Include="Npgsql" Version="8.0.5" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.0.0-rc.2" />
</ItemGroup>

</Project>
8 changes: 4 additions & 4 deletions frameworks/CSharp/aspnetcore/src/Platform/Platform.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<IsTestAssetProject>true</IsTestAssetProject>
<LangVersion>preview</LangVersion>
Expand All @@ -19,9 +19,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Npgsql" Version="8.0.3" />
<PackageReference Include="MySqlConnector" Version="2.3.1" />
<PackageReference Include="Dapper" Version="2.1.21" />
<PackageReference Include="Npgsql" Version="8.0.5" />
<PackageReference Include="MySqlConnector" Version="2.3.7" />
<PackageReference Include="Dapper" Version="2.1.35" />
<PackageReference Include="RazorSlices" Version="0.7.0" Condition="$(PublishAot) != 'true'" />
</ItemGroup>

Expand Down
1 change: 0 additions & 1 deletion frameworks/CSharp/aspnetcore/src/Platform/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ public static IWebHost BuildWebHost(string[] args)
#if DEBUG
.AddUserSecrets<Program>()
#endif
.AddEnvironmentVariables()
.AddEnvironmentVariables()
.AddCommandLine(args)
.Build();
Expand Down

0 comments on commit d0d8aa3

Please sign in to comment.