Skip to content
Merged
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
7 changes: 2 additions & 5 deletions .NET MAUI/sample-code/MauiApp2/MauiApp2.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0-android;net8.0-ios;net8.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
<!-- <TargetFrameworks>$(TargetFrameworks);net8.0-tizen</TargetFrameworks> -->
<TargetFrameworks>net10.0-android;net10.0-ios;net10.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net10.0-windows10.0.19041.0</TargetFrameworks>

<!-- Note for MacCatalyst:
The default runtime is maccatalyst-x64, except in Release config, in which case the default is maccatalyst-x64;maccatalyst-arm64.
Expand Down Expand Up @@ -35,7 +33,6 @@
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
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>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
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>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
4 changes: 2 additions & 2 deletions .devcontainer/ai/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM mcr.microsoft.com/dotnet/sdk:7.0
FROM mcr.microsoft.com/dotnet/sdk:10.0
RUN wget https://packages.microsoft.com/config/debian/11/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
RUN dpkg -i packages-microsoft-prod.deb
RUN rm packages-microsoft-prod.deb
RUN apt update && apt upgrade -y && apt install unzip curl dotnet-sdk-6.0 -y
RUN apt update && apt upgrade -y && apt install unzip curl -y
RUN dotnet tool install -g mlnet-linux-x64
ENV PATH="$PATH:/root/.dotnet/tools"
2 changes: 1 addition & 1 deletion .devcontainer/base/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"name": ".NET Beginner Series",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/dotnet:0-7.0",
"image": "mcr.microsoft.com/devcontainers/dotnet:0-10.0",

// Features to add to the dev container. More info: https://containers.dev/features.
"features": {},
Expand Down
208 changes: 208 additions & 0 deletions .github/workflows/build-validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,208 @@
name: Build Validation.

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:

jobs:
build-dotnet-samples:
name: Build .NET Samples
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'

- name: Build MyConsoleApp
run: dotnet build ".NET/sample_code/MyConsoleApp/MyConsoleApp.sln"

- name: Build MyPasswordGenerator
run: dotnet build ".NET/sample_code/MyPasswordGenerator/MyPasswordGenerator.sln"

build-blazor-samples:
name: Build Blazor Samples
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'

- name: Build Blazor - Handling Events
run: dotnet build "Frontend Web with Blazor/sample-code/handling-events/BlazorApp/BlazorApp.sln"

- name: Build Blazor - Data Binding
run: dotnet build "Frontend Web with Blazor/sample-code/data-binding/BlazorApp/BlazorApp.sln"

- name: Build Blazor - Components
run: dotnet build "Frontend Web with Blazor/sample-code/introducing-blazor-components/BlazorApp/BlazorApp.sln"

- name: Build Blazor - Pages Routing Layouts
run: dotnet build "Frontend Web with Blazor/sample-code/pages-routing-layouts/BlazorApp/BlazorApp.sln"

- name: Build Blazor - Working with Data
run: dotnet build "Frontend Web with Blazor/sample-code/working-with-data/BlazorMovieApp/BlazorMovieApp.sln"

- name: Build Blazor - Render Modes
run: dotnet build "Frontend Web with Blazor/sample-code/render-modes/BlazorApp/BlazorApp.sln"

build-webapi-samples:
name: Build Web API Samples
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'

- name: Build MyNewApp Web API
run: dotnet build "Backend Web with Web APIs/sample-code/MyNewApp.sln"

build-nuget-samples:
name: Build NuGet Samples
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'

- name: Build AppLogger
run: dotnet build "Package Management with NuGet/sample-code/AppLogger/AppLogger.sln"

- name: Build Account
run: dotnet build "Package Management with NuGet/sample-code/Account/Account.sln"

build-visualstudio-samples:
name: Build Visual Studio Samples
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'

- name: Build RazorPagesCupcakes
run: dotnet build "Visual Studio/sample-code/RazorPagesCupcakes.sln"

build-container-samples:
name: Build Container Samples
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'

- name: Build Container WebApp
run: dotnet build "Containers/sample-code/container-webapp/container-webapp.csproj"

build-ai-ml-samples:
name: Build AI/ML Samples
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'

- name: Build GitHubIssuesWebApi
run: dotnet build "Artificial Intelligence and Machine Learning/sample-code/src/GitHubIssuesWebApi/GitHubIssuesWebApi.csproj"

- name: Build ChatGPT Plugin
run: dotnet build "Artificial Intelligence and Machine Learning/sample-code/src/chatgpt-plugin/chatgpt-plugin.csproj"

- name: Build MLModels
run: dotnet build "Artificial Intelligence and Machine Learning/sample-code/src/MLModels/MLModels.csproj"

build-iot-samples:
name: Build IoT Samples
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'

- name: Build IoT Sensor
run: dotnet build "IoT/5-sensors-displays-i2c/code/Sensor/Sensor.csproj"

- name: Build IoT Adc
run: dotnet build "IoT/6-adc-spi/code/Adc/Adc.csproj"

- name: Build IoT Temperature
run: dotnet build "IoT/6-adc-spi/code/temperature/temperature.csproj"

build-blazor-hybrid-samples:
name: Build Blazor Hybrid Samples
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'

- name: Build HybridTodoApp Components
run: dotnet build "Blazor Hybrid/sample-code/HybridTodoApp.Components/HybridTodoApp.Components.csproj"

- name: Build HybridTodoApp Website
run: dotnet build "Blazor Hybrid/sample-code/HybridTodoApp.Website/HybridTodoApp.Website.csproj"

build-maui-samples:
name: Build MAUI Samples (Windows)
runs-on: windows-latest
# Note: MAUI projects require platform-specific workloads and are built on Windows

steps:
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'

- name: Install .NET MAUI workload
run: dotnet workload install maui

- name: Restore MauiApp2
run: dotnet restore ".NET MAUI/sample-code/MauiApp2.sln"

- name: Build MauiApp2 (Windows only)
run: dotnet build ".NET MAUI/sample-code/MauiApp2.sln" -f net10.0-windows10.0.19041.0

- name: Restore HybridTodoApp
run: dotnet restore "Blazor Hybrid/sample-code/HybridTodoApp.sln"

- name: Build HybridTodoApp (Windows only)
run: dotnet build "Blazor Hybrid/sample-code/HybridTodoApp/HybridTodoApp.csproj" -f net10.0-windows10.0.19041.0
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<LangVersion>preview</LangVersion>
<PlatformTarget>x64</PlatformTarget>
<ImplicitUsings>enable</ImplicitUsings>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>chatgpt_plugin</RootNamespace>
Expand Down
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>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion Backend Web with Web APIs/sample-code/MyNewApp/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
app.MapPost("/todos", (Todo task, ITaskService service) =>
{
service.AddTodo(task);
return TypedResults.Created($"/todos/{id}", task);
return TypedResults.Created($"/todos/{task.Id}", task);
})
.AddEndpointFilter(async (context, next) => {
var taskArgument = context.GetArgument<Todo>(0);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UseMauiEssentials>true</UseMauiEssentials>
Expand Down
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>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UseMauiEssentials>true</UseMauiEssentials>
Expand Down
9 changes: 3 additions & 6 deletions Blazor Hybrid/sample-code/HybridTodoApp/HybridTodoApp.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<TargetFrameworks>net8.0-android;net8.0-ios;net8.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
<!-- <TargetFrameworks>$(TargetFrameworks);net8.0-tizen</TargetFrameworks> -->
<TargetFrameworks>net10.0-android;net10.0-ios;net10.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net10.0-windows10.0.19041.0</TargetFrameworks>

<!-- Note for MacCatalyst:
The default runtime is maccatalyst-x64, except in Release config, in which case the default is maccatalyst-x64;maccatalyst-arm64.
Expand Down Expand Up @@ -35,7 +33,6 @@
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">24.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
</PropertyGroup>

<ItemGroup>
Expand Down Expand Up @@ -83,7 +80,7 @@
<UseHardenedRuntime>true</UseHardenedRuntime>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)'=='net8.0-ios'">
<PropertyGroup Condition="'$(TargetFramework)'=='net10.0-ios'">
<CodesignKey>Apple Development: Created via API (M23D499R8F)</CodesignKey>
<CodesignProvision>VS: WildCard Development</CodesignProvision>
</PropertyGroup>
Expand Down
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>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>container_webapp</RootNamespace>
Expand Down
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>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
Expand Down
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>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
Expand Down
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>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
Expand Down
Loading