Skip to content

Upgrade projects to .NET 10 - #12921

Open
gewarren wants to merge 7 commits into
dotnet:mainfrom
gewarren:upgrade-system
Open

Upgrade projects to .NET 10#12921
gewarren wants to merge 7 commits into
dotnet:mainfrom
gewarren:upgrade-system

Conversation

@gewarren

Copy link
Copy Markdown
Collaborator

Contributes to #12713.

Copilot AI review requested due to automatic review settings July 31, 2026 21:15
@gewarren
gewarren requested a review from a team as a code owner July 31, 2026 21:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates a set of C# snippet projects to modern SDK-style project files targeting .NET 10, aligning with the “Modernize all C# code snippets” effort in #12713.

Changes:

  • Converted legacy, non-SDK-style .csproj files to SDK-style projects and updated TFMs to net10.0 / net10.0-windows.
  • Added Windows Desktop settings (UseWPF, UseWindowsForms) and a few required package references for desktop/snippet compilation.
  • Tightened project item inclusion via EnableDefault*Items and explicit <Compile/> / resource item lists.

Reviewed changes

Copilot reviewed 30 out of 30 changed files in this pull request and generated 16 comments.

Show a summary per file
File Description
snippets/csharp/System/String/Overview/instantiate1.csproj Migrate to SDK-style and target net10.0 for the String instantiation snippet project.
snippets/csharp/System/IObservableT/Overview/locationtrackercs.csproj Migrate to SDK-style and target net10.0 for the IObservable snippet project.
snippets/csharp/System/IntPtr/ToPointer/example.csproj Migrate to SDK-style and target net10.0 for IntPtr.ToPointer snippet project.
snippets/csharp/System/IntPtr/Overview/example.csproj Migrate to SDK-style and target net10.0 for IntPtr overview snippet project.
snippets/csharp/System/Exception/Overview/customexceptioncs.csproj Migrate to SDK-style and target net10.0 for custom exception snippet project.
snippets/csharp/System/Convert/IsDBNull/IsDBNull_To_NA_CS.csproj Migrate to SDK-style, target net10.0-windows, and modernize WinForms/resource items + SqlClient reference.
snippets/csharp/System/Console/Overview/setfont1.csproj Migrate to SDK-style and target net10.0 for Console set font snippet project.
snippets/csharp/System.Timers/Timer/SynchronizingObject/SynchronizingObjectCS1.csproj Migrate to SDK-style, target net10.0-windows, and set WinForms-related properties.
snippets/csharp/System.Text.RegularExpressions/Regex/CompileToAssembly/compiletoassembly1.csproj Migrate to SDK-style and target net10.0 for regex compile-to-assembly snippet project.
snippets/csharp/System.Security/SecureString/.ctor/securestringctor.csproj Migrate to SDK-style and target net10.0 for SecureString ctor snippet project.
snippets/csharp/System.Runtime.InteropServices/SafeHandle/Overview/safehandle.csproj Migrate to SDK-style, target net10.0, and add required permissions package reference.
snippets/csharp/System.Runtime.CompilerServices/FixedAddressValueTypeAttribute/Overview/fixedaddress.csproj Migrate to SDK-style and target net10.0 for FixedAddressValueTypeAttribute snippet project.
snippets/csharp/System.Printing/PrintServer/Overview/PrintServerCreate.csproj Migrate to SDK-style, target net10.0-windows, and enable WPF for System.Printing sample compilation.
snippets/csharp/System.Printing/PrintQueue/HasPaperProblem/PrinterStatusSurvey.csproj Migrate to SDK-style, target net10.0-windows, and enable WPF for System.Printing sample compilation.
snippets/csharp/System.Printing/PrintQueue/Commit/Management_PrintTicket.csproj Migrate to SDK-style, target net10.0-windows, and enable WPF for print ticket sample compilation.
snippets/csharp/System.Printing/PrintJobStatus/Overview/DiagnoseProblematicPrintJob.csproj Migrate to SDK-style, target net10.0-windows, and enable WPF for print job status sample compilation.
snippets/csharp/System.Printing/LocalPrintServer/GetDefaultPrintQueue/GetPrintObjectPropertiesWithoutReflection.csproj Migrate to SDK-style, target net10.0-windows, and enable WPF for local print server sample compilation.
snippets/csharp/System.Printing/LocalPrintServer/.ctor/ClonePrinter.csproj Migrate to SDK-style, target net10.0-windows, and enable WPF for local print server sample compilation.
snippets/csharp/System.Printing/EnumeratedPrintQueueTypes/Overview/EnumerateSubsetOfPrintQueues.csproj Migrate to SDK-style, target net10.0-windows, and enable WPF for print queue enumeration sample compilation.
snippets/csharp/System.Printing/Collation/Overview/XpsCreate.csproj Migrate to SDK-style, target net10.0-windows, and enable WinForms/WPF for XPS creation sample compilation.
snippets/csharp/System.IO/StreamWriter/Overview/streamreadwrite.csproj Migrate to SDK-style and target net10.0 for StreamWriter read/write snippet project.
snippets/csharp/System.IO.Packaging/Package/Overview/PackageWrite.csproj Migrate to SDK-style, target net10.0-windows, enable WPF, and explicitly include content assets.
snippets/csharp/System.IO.Packaging/Package/GetPart/PackageRead.csproj Migrate to SDK-style, target net10.0-windows, and enable WPF for package read snippet project.
snippets/csharp/System.IO.Packaging/CertificateEmbeddingOption/Overview/PackageDigitalSignature.csproj Migrate to SDK-style, target net10.0-windows, enable WPF, and explicitly include content assets.
snippets/csharp/System.ComponentModel.Composition/ExportAttribute/consoleapplication3.csproj Migrate to SDK-style, target net10.0, and add System.ComponentModel.Composition package reference.
snippets/csharp/System.ComponentModel.Composition.Hosting/DirectoryCatalog/consoleapplication7/consoleapplication7.csproj Migrate to SDK-style, target net10.0, add package reference, and simplify project reference.
snippets/csharp/System.ComponentModel.Composition.Hosting/DirectoryCatalog/classlibrary1/classlibrary1.csproj Migrate to SDK-style, target net10.0, and add System.ComponentModel.Composition package reference.
snippets/csharp/System.ComponentModel.Composition.Hosting/CompositionContainer/Overview/consoleapplication1.csproj Migrate to SDK-style, target net10.0, and add System.ComponentModel.Composition package reference.
snippets/csharp/System.ComponentModel.Composition.Hosting/CompositionContainer/Compose/consoleapplication5.csproj Migrate to SDK-style, target net10.0, and add System.ComponentModel.Composition package reference.
snippets/csharp/System.Collections.ObjectModel/ObservableCollectionT/BlockReentrancy/ObservableCollection.csproj Migrate to SDK-style, target net10.0-windows, enable WPF, and explicitly list WPF items.

Comment thread snippets/csharp/System/String/Overview/instantiate1.csproj Outdated
Comment thread snippets/csharp/System.IO/StreamWriter/Overview/streamreadwrite.csproj Outdated
Comment thread snippets/csharp/System/Console/Overview/setfont1.csproj Outdated
Comment thread snippets/csharp/System/IObservableT/Overview/locationtrackercs.csproj Outdated
Comment thread snippets/csharp/System.Security/SecureString/.ctor/securestringctor.csproj Outdated
Comment thread snippets/csharp/System/Exception/Overview/customexceptioncs.csproj Outdated
Comment thread snippets/csharp/System.Security/SecureString/.ctor/securestringctor.csproj Outdated
Comment thread snippets/csharp/System/Console/Overview/setfont1.csproj Outdated
Comment thread snippets/csharp/System/Exception/Overview/customexceptioncs.csproj Outdated
Comment thread snippets/csharp/System/IntPtr/Overview/example.csproj Outdated
Comment thread snippets/csharp/System/IntPtr/ToPointer/example.csproj
Comment thread snippets/csharp/System/IObservableT/Overview/locationtrackercs.csproj Outdated
Comment thread snippets/csharp/System/String/Overview/instantiate1.csproj Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants