dotnet-maui-workshop icon indicating copy to clipboard operation
dotnet-maui-workshop copied to clipboard

Upgrade .NET MAUI Workshop to .NET 10

Open Copilot opened this issue 3 months ago • 6 comments

Upgrade .NET MAUI Workshop to .NET 10

Based on the official .NET MAUI 9 to 10 upgrade instructions, all tasks have been completed:

  • [x] Update all .csproj files to use net10.0 target framework monikers (TFMs)
    • [x] Update Part 1 - Displaying Data project
    • [x] Update Part 2 - MVVM project
    • [x] Update Part 3 - Navigation project
    • [x] Update Part 4 - Platform Features project
    • [x] Update Part 5 - CollectionView project
    • [x] Update Part 6 - AppThemes project
    • [x] Update Finish project
    • [x] Update Community Modules XAML projects (5 projects)
  • [x] Update Directory.Build.props file with net10.0 platform versions
  • [x] Update Directory.Build.targets file with net10.0 references
  • [x] Update documentation files to reference .NET 10, Visual Studio 2026, and VS Code with C# Dev Kit
  • [x] Replace deprecated DisplayAlert with DisplayAlertAsync in all projects
  • [x] Update Microsoft.Extensions.Logging.Debug to 10.0.-
  • [x] Update CommunityToolkit.Mvvm to 8.4.0
  • [x] Add LangVersion preview to all .csproj files to support MVVMTK0045
  • [x] Update all ViewModels to use partial property syntax (MVVM Toolkit 8.4.0 style)
  • [x] Update all README documentation to reflect new partial property syntax
  • [x] Fix README to preserve manual implementation examples (showing before/after)
  • [x] Verify projects can build with .NET 10 SDK
  • [x] Run code review and security checks

Summary

All 12 .NET MAUI projects have been successfully updated from .NET 9 to .NET 10:

  • Changed target frameworks from net9.0-* to net10.0-* in all .csproj files
  • Updated platform-specific conditions in Directory.Build.props
  • Updated documentation to reference .NET 10, Visual Studio 2026, and VS Code with C# Dev Kit
  • Replaced all deprecated DisplayAlert calls with DisplayAlertAsync (18 ViewModels updated)
  • Updated Microsoft.Extensions.Logging.Debug from 9.0.- to 10.0.-
  • Updated CommunityToolkit.Mvvm from 8.3.2 to 8.4.0
  • Added <LangVersion>preview</LangVersion> to all 12 .csproj files for C# 14 preview features support
  • Updated all ViewModels to use the new partial property syntax:
    • Changed from [ObservableProperty] bool isBusy; to [ObservableProperty] public partial bool IsBusy { get; set; }
    • Updated BaseViewModel in all 12 projects
    • Updated MonkeyDetailsViewModel in all projects with the property
    • Updated MonkeysViewModel in projects with IsRefreshing property
  • Updated all README documentation:
    • MVVM Toolkit sections show the new partial property syntax
    • Manual implementation sections (showing INotifyPropertyChanged before using the toolkit) preserve the original field-based syntax for educational purposes
  • Verified builds succeed with .NET 10 SDK with no warnings or errors
Original prompt

This section details on the original issue you should resolve

<issue_title>Update to .NET 10</issue_title> <issue_description>Update all projects based on https://github.com/github/awesome-copilot/blob/main/instructions/dotnet-maui-9-to-dotnet-maui-10-upgrade.instructions.md</issue_description>

<agent_instructions>Ensure you follow instructiosn: https://github.com/github/awesome-copilot/blob/main/instructions/dotnet-maui-9-to-dotnet-maui-10-upgrade.instructions.md</agent_instructions>

Comments on the Issue (you are @copilot in this section)

  • Fixes dotnet-presentations/dotnet-maui-workshop#151

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot avatar Nov 17 '25 22:11 Copilot

@copilot We will want to tell people they will need .NET 10 and Visual Studio 2026 or Visual Studio Code with the C# Dev Kit. Visual Studio 2022 isn't supported with .NET 10

Also https://learn.microsoft.com/en-us/dotnet/maui/whats-new/dotnet-10?view=net-maui-10.0 for anythign deprecated we need to rmvoe at all

jamesmontemagno avatar Nov 17 '25 22:11 jamesmontemagno

@copilot We will want to tell people they will need .NET 10 and Visual Studio 2026 or Visual Studio Code with the C# Dev Kit. Visual Studio 2022 isn't supported with .NET 10

Also https://learn.micros...

Updated in commit 722f1af:

  • Changed README to reference Visual Studio 2026 and VS Code with C# Dev Kit
  • Replaced all deprecated DisplayAlert calls with DisplayAlertAsync across all 18 ViewModels
  • Verified build succeeds with no warnings

Copilot avatar Nov 17 '25 22:11 Copilot

@copilot let's update the logging to 10.0.-

Also update the community toolkit to 8.4.0, but take into consideration https://learn.microsoft.com/en-us/dotnet/communitytoolkit/mvvm/generators/errors/mvvmtk0045 and that we need to set LangVersion to preview in the csprj

jamesmontemagno avatar Nov 17 '25 23:11 jamesmontemagno

@copilot let's update the logging to 10.0.-

Also update the community toolkit to 8.4.0, but take into consideration https://learn.microsoft.com/en-us/dotnet/communitytoolkit/mvvm/generators/erro...

Updated in commit 7ea2204:

  • Updated Microsoft.Extensions.Logging.Debug from 9.0.- to 10.0.-
  • Updated CommunityToolkit.Mvvm from 8.3.2 to 8.4.0
  • Added <LangVersion>preview</LangVersion> to all 12 .csproj files to support C# 14 preview features and avoid MVVMTK0045 warnings
  • Verified build succeeds with no warnings

Copilot avatar Nov 17 '25 23:11 Copilot

@copilot We will want to update all viewmodels and all documentation to use the new mvvm toolkit style in 8.4.0

FROM:

[ObservableProperty] string title;

To: [ObservableProperty] public partial string Title { get; set; }

do thi sin all projects and update all readmes

jamesmontemagno avatar Nov 17 '25 23:11 jamesmontemagno

@copilot We will want to update all viewmodels and all documentation to use the new mvvm toolkit style in 8.4.0

FROM:...

Updated in commit 982c240:

  • Updated all ViewModels (31 files) to use the new MVVM Toolkit 8.4.0 partial property syntax
  • Changed from [ObservableProperty] string title; to [ObservableProperty] public partial string Title { get; set; }
  • Updated BaseViewModel in all 12 projects
  • Updated MonkeyDetailsViewModel and MonkeysViewModel across all projects
  • Updated all README files (English, Chinese Simplified, Chinese Traditional) with new syntax examples and explanations of partial properties
  • Updated generated code examples to show C# 14's field keyword usage
  • Verified build succeeds with no warnings or errors

Copilot avatar Nov 17 '25 23:11 Copilot