Skip to content

.NET 9 support #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 19 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@

"features": {
"ghcr.io/azure/azure-dev/azd:latest": {},
"ghcr.io/devcontainers/features/dotnet:latest": {},
"ghcr.io/devcontainers/features/dotnet:2": {
"version": "8.0",
"additionalVersions": "9.0",
"workloads": "aspire"
},
"ghcr.io/devcontainers/features/github-cli:latest": {},
"ghcr.io/devcontainers/features/java:latest": {
"installGradle": true,
Expand Down
4 changes: 0 additions & 4 deletions .devcontainer/post-create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ sudo apt-get update && \
sudo apt clean -y && \
sudo rm -rf /var/lib/apt/lists/*

## Install .NET Aspire workload
sudo dotnet workload install aspire
sudo dotnet workload update --from-previous-sdk

## Install dev certs
dotnet tool update -g linux-dev-certs
dotnet linux-dev-certs install
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci-test-reporting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
uses: phoenix-actions/test-reporting@v15
id: test-report
with:
name: ".NET Test report"
path: "*.trx"
name: ".NET Test report $1"
path: "**/*.trx"
reporter: dotnet-trx
artifact: test-results
artifact: /test-results-(.*)/
9 changes: 7 additions & 2 deletions .github/workflows/dotnet-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ jobs:
build:
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
os: [
windows-latest
, ubuntu-latest
#, macos-latest
]
fail-fast: false
runs-on: "${{ matrix.os }}"
env:
DOTNET_CONFIGURATION: Release
Expand Down Expand Up @@ -91,7 +96,7 @@ jobs:
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results
name: test-results-${{ matrix.os }}
path: |
${{ github.workspace }}/test-results/**

Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/dotnet-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ jobs:
build:
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
os: [
windows-latest
, ubuntu-latest
#, macos-latest
]
fail-fast: false
runs-on: "${{ matrix.os }}"
env:
DOTNET_CONFIGURATION: Release
Expand Down Expand Up @@ -90,7 +95,7 @@ jobs:
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results
name: test-results-${{ matrix.os }}
path: |
${{ github.workspace }}/test-results/**

Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/dotnet-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ jobs:
build:
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
os: [
windows-latest
, ubuntu-latest
#, macos-latest
]
fail-fast: false
runs-on: "${{ matrix.os }}"
env:
DOTNET_CONFIGURATION: Release
Expand Down Expand Up @@ -90,7 +95,7 @@ jobs:
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results
name: test-results-${{ matrix.os }}
path: |
${{ github.workspace }}/test-results/**

Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ test-results
TestResults
nuget
.pnpm-store

*.binlog
11 changes: 7 additions & 4 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
<Project>
<!-- See https://aka.ms/dotnet/msbuild/customize for more details on customizing your build -->
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<LangVersion>latest</LangVersion>

<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<WarningsAsErrors>true</WarningsAsErrors>

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

<PropertyGroup>
<AspireVersion>8.2.0</AspireVersion>
<AspNetCoreVersion>8.0.7</AspNetCoreVersion>
<OpenTelemetryVersion>1.9.0</OpenTelemetryVersion>
</PropertyGroup>

<IsPackable>false</IsPackable>
</PropertyGroup>
</Project>
7 changes: 7 additions & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project>
<Target Name="_SetVSTestLogger" BeforeTargets="VSTest" Condition=" '$(TrxLogFileNameSuffix)' != '' ">
<PropertyGroup>
<VSTestLogger>trx%3BLogFileName=$(AssemblyName)-$(TargetFramework).trx</VSTestLogger>
</PropertyGroup>
</Target>
</Project>
3 changes: 2 additions & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>

<ItemGroup>
<!-- Aspire packages -->
<PackageVersion Include="Aspire.Hosting" Version="$(AspireVersion)" />
Expand All @@ -28,7 +29,7 @@
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageVersion Include="xunit" Version="2.9.0" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.2" />
<!-- External packages -->
<!-- Integration packages dependencies -->
<PackageVersion Include="OllamaSharp" Version="3.0.7" />
</ItemGroup>
</Project>
9 changes: 9 additions & 0 deletions examples/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Project>
<Import Project="..\Directory.Build.props" />

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<ProjectReference Include="..\..\..\src\CommunityToolkit.Aspire.Hosting.Java\CommunityToolkit.Aspire.Hosting.Java.csproj" IsAspireProjectResource="false" />
</ItemGroup>

<Target Name="PublishRunMaven" AfterTargets="Build">
<Target Name="PublishRunMaven" AfterTargets="Build" Condition="'$(TargetFramework)' == 'net8.0'">
<!-- As part of publishing, ensure the Java app is freshly built -->
<Exec WorkingDirectory="$(JavaAppRoot)" Command="./mvnw --quiet clean package" />
</Target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsAspireHost>true</IsAspireHost>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsAspireHost>true</IsAspireHost>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsAspireSharedProject>true</IsAspireSharedProject>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,4 @@
<ProjectReference Include="..\CommunityToolkit.Aspire.StaticWebApps.ServiceDefaults\CommunityToolkit.Aspire.StaticWebApps.ServiceDefaults.csproj" />
</ItemGroup>

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

</Project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsAspireSharedProject>true</IsAspireSharedProject>
Expand Down
5 changes: 0 additions & 5 deletions global.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if NET8_0
using CommunityToolkit.Aspire.Testing;
using FluentAssertions;
using System.Net;
Expand All @@ -13,7 +14,7 @@ public async Task CanAccessFrontendSuccessfully()
{
var httpClient = fixture.CreateHttpClient("swa");

await fixture.App.WaitForTextAsync("Azure Static Web Apps emulator started", "swa").WaitAsync(TimeSpan.FromSeconds(30));
await fixture.App.WaitForTextAsync("Azure Static Web Apps emulator started", "swa").WaitAsync(TimeSpan.FromMinutes(5));

var response = await httpClient.GetAsync("/");

Expand All @@ -25,7 +26,7 @@ public async Task CanAccessApiSuccessfully()
{
var httpClient = fixture.CreateHttpClient("swa");

await fixture.App.WaitForTextAsync("Azure Static Web Apps emulator started", "swa").WaitAsync(TimeSpan.FromSeconds(30));
await fixture.App.WaitForTextAsync("Azure Static Web Apps emulator started", "swa").WaitAsync(TimeSpan.FromMinutes(5));

var response = await httpClient.GetAsync("/api/weather");

Expand All @@ -36,4 +37,5 @@ public async Task CanAccessApiSuccessfully()
}

record WeatherForecast(DateTime Date, int TemperatureC, string Summary);
}
}
#endif
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
<Project Sdk="Microsoft.NET.Sdk">

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

</Project>
Loading