Skip to content

Commit

Permalink
Upgrade to .NET 8.0
Browse files Browse the repository at this point in the history
Default port changes from 80 to 8080
  • Loading branch information
daniel-lerch committed Nov 15, 2023
1 parent 5d22c92 commit 21a1240
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Setup .NET SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
dotnet-version: 8.0.x
- name: Restore NuGet packages
run: dotnet restore
- name: Build
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build-env
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env
WORKDIR /app

# Copy csproj and restore as distinct layers
Expand All @@ -14,7 +14,7 @@ COPY . ./
RUN dotnet publish --no-restore -c Release -o /app/out src/TravelBlog/TravelBlog.csproj

# Build runtime image
FROM mcr.microsoft.com/dotnet/aspnet:6.0
FROM mcr.microsoft.com/dotnet/aspnet:8.0
WORKDIR /app
COPY --from=build-env /app/out .
ENTRYPOINT ["dotnet", "TravelBlog.dll"]
2 changes: 1 addition & 1 deletion src/TravelBlog/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public static void Main(string[] args)
app.UseCookiePolicy();
app.UseAuthentication();
app.UseAuthorization();
app.UseEndpoints(endpoints => endpoints.MapControllers());
app.MapControllers();
app.Run();
}
}
18 changes: 9 additions & 9 deletions src/TravelBlog/TravelBlog.csproj
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<Company />
<Authors>Daniel Lerch</Authors>
<Copyright>© 2019-2022 Daniel Lerch</Copyright>
<Copyright>© 2019-2023 Daniel Lerch</Copyright>
<PackageLicenseExpression>MIT License</PackageLicenseExpression>
<UserSecretsId>9eb7eda1-7c08-4fa1-aca3-363ec6bc312e</UserSecretsId>
</PropertyGroup>


<ItemGroup>
<PackageReference Include="MailKit" Version="4.0.0" />
<PackageReference Include="Markdig" Version="0.31.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="6.0.16" Condition="'$(Configuration)' == 'Debug'" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.16">
<PackageReference Include="MailKit" Version="4.3.0" />
<PackageReference Include="Markdig" Version="0.33.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="8.0.0" Condition="'$(Configuration)' == 'Debug'" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.16" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.0" />
<PackageReference Include="Nito.AsyncEx.Coordination" Version="5.1.2" />
<PackageReference Include="NetVips" Version="2.3.0" />
<PackageReference Include="NetVips.Native" Version="8.14.2" />
<PackageReference Include="NetVips" Version="2.4.0" />
<PackageReference Include="NetVips.Native" Version="8.15.0" />
<PackageReference Include="UAParser" Version="3.1.47" />
<PackageReference Include="Wiry.Base32" Version="1.1.1" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/TravelBlog/Views/Shared/_Layout.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@

<footer class="border-top footer text-muted">
<div class="container">
&copy; 2019-2022 Daniel Lerch <small>mit Icons von <a href="https://icons8.com">Icons8</a></small>
&copy; 2019-2023 Daniel Lerch <small>mit Icons von <a href="https://icons8.com">Icons8</a></small>
</div>
</footer>

Expand Down
4 changes: 2 additions & 2 deletions tests/TravelBlog.Tests/JobSchedulerServiceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public async Task TestStart()
Assert.Equal(new[] { data }, await context.GetJobs());
data.SetResult(true);
await Task.Delay(50);
Assert.Equal(0, (await context.GetJobs()).Count);
Assert.Empty(await context.GetJobs());
await jobScheduler.StopAsync(default);
}

Expand All @@ -41,7 +41,7 @@ public async Task TestStop()
Assert.False(stop.IsCompleted);
data.SetResult(true);
await stop;
Assert.Equal(0, (await context.GetJobs()).Count);
Assert.Empty(await context.GetJobs());
}

[Fact]
Expand Down
10 changes: 5 additions & 5 deletions tests/TravelBlog.Tests/TravelBlog.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.0" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.6.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.3">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.2.0">
<PackageReference Include="coverlet.collector" Version="6.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down

0 comments on commit 21a1240

Please sign in to comment.