Skip to content

Upgrade to using .NET 10#111

Merged
supermem613 merged 26 commits intomainfrom
dotnet-core
Nov 19, 2025
Merged

Upgrade to using .NET 10#111
supermem613 merged 26 commits intomainfrom
dotnet-core

Conversation

@supermem613
Copy link
Contributor

@supermem613 supermem613 commented Nov 18, 2025

This pull request modernizes the project by updating the build system to use .NET 10, refactoring platform targeting and dependencies, and making several code improvements for compatibility and maintainability. The most important changes include updating the CI/CD workflows to use newer actions and .NET versions, changing the target framework in the core library, adding platform support annotations, and replacing deprecated APIs.

Build System and Workflow Modernization

  • Updated both .github/workflows/CI.yml and .github/workflows/CD.yml to use newer GitHub Actions versions (actions/checkout@v4, actions/setup-dotnet@v4, etc.), switched build steps to use dotnet build, and upgraded dependencies for GitVersion and WiX Toolset. Also added explicit permissions in CI. [1] [2] [3] [4]

Platform Targeting and Dependencies

  • Changed the target framework in Microsoft.Tools.TeamMate.Foundation.csproj from net48 to net10.0-windows10.0.19041.0, removed legacy references, and updated NuGet package versions for compatibility with .NET 10. [1] [2]
  • Added [SupportedOSPlatform("windows10.0.19041.0")] annotations to multiple classes and assemblies to clarify platform requirements. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]

Code Compatibility and Refactoring

  • Replaced deprecated BinaryFormatter serialization with System.Text.Json in ApplicationInstance, and improved file handle usage for safer deserialization. [1] [2]
  • Updated process launching in ExternalWebBrowser.cs to use ProcessStartInfo with UseShellExecute = true for .NET 10 compatibility.
  • Improved DPI handling in HintTextAdorner.cs by using VisualTreeHelper.GetDpi and passing PixelsPerDip to FormattedText.

Structs and Interop Adjustments

  • Added a new FILETIME struct for P/Invoke, and fixed handle checks in interop code to use IntPtr.Zero instead of null. [1] [2]

Miscellaneous Cleanups

  • Removed obsolete or redundant code, such as legacy serialization constructors, [Serializable] attributes, and unnecessary reliability contracts. [1] [2] [3]

This update brings the codebase up to date with modern .NET and Windows platform requirements, improves build reliability, and enhances code safety and maintainability.

Fixes #105
Fixes #93
Addresses https://github.com/microsoft/TeamMate/security/code-scanning/1

Marcus Markiewicz added 18 commits November 18, 2025 12:55
- Updated target framework to net9.0-windows for multiple projects.
- Replaced deprecated BinaryFormatter with System.Text.Json for serialization in ApplicationInstance.
- Introduced InMemoryTokenStorage for temporary token caching during Azure DevOps SDK migration.
- Updated various package references to their latest versions.
- Removed unsupported references and configurations related to previous .NET versions.
- Adjusted ToastNotificationManager to ensure compatibility with new namespace requirements.
- Added new warnings to NoWarn in Directory.Build.props and various .csproj files.
- Updated PackageReference version for System.ServiceModel.Primitives in Foundation project.
- Removed unused references in TeamMate.csproj.
…URLs

Updated the Launch method to utilize ProcessStartInfo with UseShellExecute set to true, ensuring better handling of the browser launch process.
- Updated Directory.Build.props and TeamMate.csproj to remove SYSLIB0012 from the NoWarn list, ensuring cleaner build output.
Updated NoWarn properties in TeamMate.csproj and Microsoft.Tools.TeamMate.WindowsRuntime.csproj to remove warning code 467, streamlining the warning suppression for better clarity and maintenance.
Removed warning code 618 from NoWarn properties in both TeamMate.csproj and Microsoft.Tools.TeamMate.WindowsRuntime.csproj to clean up the project configuration.
…ding method

- Removed CA2022 from NoWarn properties in Directory.Build.props and Microsoft.Tools.TeamMate.Foundation.csproj.
- Updated ApplicationInstance.cs to use ReadExactly for reading messages from file stream.
- Changed the URI encoding method in SetHtml to use WebUtility.HtmlEncode for absoluteUri to ensure proper HTML formatting.
- Removed unnecessary warning codes from NoWarn properties in project files.
- Updated icon handle checks in InteropUtilities to use IntPtr.Zero instead of null for better clarity and consistency.
- Removed warning codes 467 and 618 from NoWarn properties in multiple project files.
- Updated FormattedText instantiation to include DPI information in HintTextAdorner and UI classes.
- Improved file handling in ApplicationInstance by using SafeFileHandle.
- Removed obsolete CA1416 warning suppression from project files.
- Added SupportedOSPlatform attributes to AssemblyInfo.cs files for better platform targeting.
- Changed project file to use WiX Toolset SDK version 5.0.2.
- Updated Product.wxs to align with WiX v4 schema and improved directory structure.
- Added RuntimeIdentifier and SelfContained properties to TeamMate.csproj for better deployment configuration.
- Upgraded actions/checkout from v2 to v4 in both CI and CD workflows.
- Updated GitVersion setup and execution actions to v1.1.1.
- Changed .NET version in setup from 5.0.x to 10.0.x.
- Replaced MSBuild commands with dotnet build for consistency across workflows.
@supermem613 supermem613 requested a review from Copilot November 18, 2025 20:21
@supermem613 supermem613 self-assigned this Nov 18, 2025
@supermem613 supermem613 added bug Something isn't working enhancement New feature or request tech debt Issues and pull requests related to addressing technical debt or improving the codebase labels Nov 18, 2025
- Updated the GitVersion setup and execute actions from v1.1.1 to v3.0.0 in both CI.yml and CD.yml.
- Ensured compatibility with the latest version specifications for improved functionality.
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR modernizes the TeamMate application by upgrading from .NET Framework 4.8 to .NET 10, targeting Windows 10 build 19041.0. The upgrade includes significant infrastructure changes to CI/CD, authentication mechanisms, and code compatibility adjustments.

  • Updated GitHub Actions workflows to use newer versions and switched from MSBuild to dotnet build commands
  • Migrated authentication from deprecated VssClientCredentials to MSAL-based token acquisition with Azure.Identity
  • Replaced deprecated BinaryFormatter serialization with System.Text.Json
  • Updated WiX installer from v3 to v5 with modernized XML schema

Reviewed Changes

Copilot reviewed 164 out of 164 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
.github/workflows/CI.yml, CD.yml Updated to newer action versions, .NET 10 SDK, GitVersion 6.x, and WiX 5.0.2
Source/TeamMate/TeamMate.csproj Changed target framework to net10.0-windows10.0.19041.0, updated package dependencies
Source/Foundation/Microsoft.Tools.TeamMate.Foundation.csproj Updated to net10.0-windows10.0.19041.0, removed legacy references
Source/TeamMate/Services/VstsConnectionService.cs Replaced VssClientCredentials with MSAL authentication flow using Azure.Identity
Source/Foundation/Windows/Shell/ApplicationInstance.cs Replaced BinaryFormatter with System.Text.Json for IPC serialization
Source/Setup/Product.wxs Migrated WiX installer from v3 to v5 schema with updated component structure
Multiple ViewModels, Services, Utilities Added SupportedOSPlatform attributes for platform-specific API usage
Source/Foundation/Windows/Controls/HintTextAdorner.cs Updated FormattedText constructor to include PixelsPerDip for DPI awareness
Source/Foundation/Shell/ExternalWebBrowser.cs Updated Process.Start to use ProcessStartInfo with UseShellExecute for .NET 10
Source/Foundation/Native/Structs.cs Added FILETIME struct and removed deprecated ReliabilityContract attribute

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…ring logic

- Changed HintTextFontStyle property to nullable type for better handling of font styles.
- Simplified hint text rendering logic to use null-coalescing operator for default font style.
- Updated HTML encoding in DataObjectExtensions to use Uri.EscapeDataString for better URI handling.
- Enhanced exception handling in VstsConnectionService for cache read/write operations.
- Added GetTokenKeyString method for consistent token key handling.
- Minor formatting adjustments in WorkItemQueryTileViewModel and ToastNotificationManager.
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 165 out of 165 changed files in this pull request and generated 7 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Updated the serialization logic in ApplicationInstance to use the object's type for preserving type information during polymorphic serialization.
Added a MessageEnvelope class to wrap messages with type metadata for proper deserialization. Updated the serialization and deserialization logic to utilize the envelope, ensuring the correct type is preserved and validated during message handling.
@supermem613 supermem613 merged commit 2993057 into main Nov 19, 2025
5 checks passed
@supermem613 supermem613 deleted the dotnet-core branch November 19, 2025 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request tech debt Issues and pull requests related to addressing technical debt or improving the codebase

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Address BinaryFormatter usage Long-term plan needed for .net framework dependency

2 participants