Skip to content

Conversation

Copy link

Copilot AI commented Aug 8, 2025

This PR modernizes the Spark project from .NET 5.0/.NET 6.0 to .NET 8.0, updating all dependencies and replacing deprecated APIs to ensure compatibility with current development environments and CI/CD pipelines.

Key Changes

Framework Updates

  • Updated global.json: Migrated from .NET 5.0 to .NET 8.0
  • Target framework: Changed from net6.0-windows10.0.17763.0 to net8.0-windows for simplified targeting
  • C# language version: Upgraded from C# 9 to C# 12 to leverage latest language features

Package Modernization

Updated all Microsoft packages to their .NET 8.0 compatible versions:

  • Microsoft.Data.Sqlite: 7.0.2 → 8.0.0
  • Microsoft.Web.WebView2: 1.0.1518.46 → 1.0.2592.51
  • Microsoft.Win32.SystemEvents: 7.0.0 → 8.0.0
  • System.Configuration.ConfigurationManager: 7.0.0 → 8.0.0
  • System.Management: 7.0.0 → 8.0.0
  • Newtonsoft.Json: 13.0.2 → 13.0.3
  • NAudio: 2.1.0 → 2.2.1
  • Microsoft.Windows.SDK.BuildTools: 10.0.22621.1 → 10.0.26100.1

API Modernization

Replaced the deprecated WindowsAPICodePack-Shell package with the modern .NET OpenFolderDialog API:

// Before: Using deprecated WindowsAPICodePack
CommonOpenFileDialog folderBrowserDialog = new CommonOpenFileDialog
{
    InitialDirectory = SparkSettings.instance.saveFolder,
    IsFolderPicker = true
};

// After: Using modern .NET API
var folderBrowserDialog = new OpenFolderDialog
{
    InitialDirectory = SparkSettings.instance.saveFolder
};

Build Configuration

  • Simplified project SDK reference for better compatibility
  • Maintained Windows-specific WPF and Windows Forms functionality
  • Added comprehensive documentation and validation script
  • Fixed validation script: Corrected grep pattern in validate-modernization.sh to properly match XML elements

CI/CD Automation

Added GitHub Actions workflow (.github/workflows/build.yml) for automated builds:

  • Framework-dependent build: Creates smaller artifacts requiring .NET 8.0 runtime on target machine
  • Self-contained build: Includes .NET runtime in a single-file executable with native libraries
  • Runs on Windows runners for WPF/Windows Forms compatibility
  • Triggers on push/PR to main, master, and develop branches
  • Supports manual workflow dispatch
  • Artifacts retained for 30 days with automatic upload
  • Implements security best practices with explicit GITHUB_TOKEN permissions

Benefits

  • Performance: Access to .NET 8.0 performance improvements
  • Security: Latest package versions with security patches
  • Maintainability: Modern APIs and elimination of deprecated dependencies
  • Future-proofing: Positioned for easier future updates
  • Developer Experience: Better IDE support and debugging capabilities
  • Automation: Continuous integration with automated build artifact generation

Testing

The modernization has been validated with an automated script that verifies:

  • Package restore functionality
  • Project file structure
  • Dependency compatibility
  • API modernization
  • Removal of deprecated packages

Security

  • ✅ CodeQL security analysis passed with 0 alerts
  • ✅ Explicit GITHUB_TOKEN permissions configured
  • ✅ No secrets or sensitive data exposed in workflow files
  • ✅ Certificate files properly excluded via .gitignore

The project remains a Windows-specific WPF application and requires a Windows environment with .NET 8.0 workloads for full compilation.

Fixes #1.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copy link
Author

Copilot AI commented Aug 8, 2025

@thesprockee 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs.

I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review.

Copilot AI and others added 2 commits August 8, 2025 23:48
Co-authored-by: thesprockee <962164+thesprockee@users.noreply.github.com>
Co-authored-by: thesprockee <962164+thesprockee@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix build on chore/modernize branch Modernize Spark project to .NET 8.0 and update dependencies Aug 8, 2025
Copilot AI requested a review from thesprockee August 8, 2025 23:53
@thesprockee thesprockee marked this pull request as ready for review August 9, 2025 01:02
Copilot AI review requested due to automatic review settings August 9, 2025 01:02
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 Spark project from .NET 5.0/.NET 6.0 to .NET 8.0, updating all dependencies to their latest compatible versions and replacing deprecated APIs with modern alternatives.

  • Upgraded framework from .NET 5.0/.NET 6.0 to .NET 8.0 with C# 12 language features
  • Updated all Microsoft packages to .NET 8.0 compatible versions
  • Replaced deprecated WindowsAPICodePack-Shell with modern OpenFolderDialog API

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
global.json Updates SDK version from 5.0 to 8.0
Spark.csproj Modernizes target framework, language version, and all package references
SparkMSIX/SparkMSIX.wapproj Updates Windows SDK BuildTools to latest version
Windows/Settings/UnifiedSettingsWindow.xaml.cs Replaces deprecated WindowsAPICodePack with OpenFolderDialog
validate-modernization.sh Adds validation script for modernization changes
MODERNIZATION.md Provides comprehensive documentation of changes

string selectedPath = "";
CommonOpenFileDialog folderBrowserDialog = new CommonOpenFileDialog

var folderBrowserDialog = new OpenFolderDialog
Copy link

Copilot AI Aug 9, 2025

Choose a reason for hiding this comment

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

The OpenFolderDialog class requires a using statement for Microsoft.Win32 namespace. Verify that the appropriate using directive is added to ensure the code compiles correctly.

Copilot uses AI. Check for mistakes.
@thesprockee thesprockee marked this pull request as draft November 21, 2025 20:17
@thesprockee
Copy link
Member

@copilot

setup the github actions to build the executable, then refactor/add anything required to get it building.

Copilot AI and others added 2 commits November 21, 2025 20:21
Co-authored-by: thesprockee <962164+thesprockee@users.noreply.github.com>
Co-authored-by: thesprockee <962164+thesprockee@users.noreply.github.com>
Copy link
Author

Copilot AI commented Nov 21, 2025

@copilot

setup the github actions to build the executable, then refactor/add anything required to get it building.

GitHub Actions workflow created in commit 474f461. The workflow includes two build jobs:

  1. Framework-dependent build - Smaller, requires .NET 8.0 runtime on target machine
  2. Self-contained build - Includes .NET runtime, no installation required

Both jobs build the Spark executable on Windows runners and upload artifacts that are retained for 30 days. The workflow triggers on pushes/PRs to main/master/develop branches and can be manually triggered.

MSIX packaging was not included as it requires a code signing certificate to be stored as a GitHub secret. The README in .github/workflows/ explains how to add this in the future if needed.

Copilot AI and others added 2 commits November 21, 2025 20:24
Co-authored-by: thesprockee <962164+thesprockee@users.noreply.github.com>
Co-authored-by: thesprockee <962164+thesprockee@users.noreply.github.com>
Copilot AI changed the title Modernize Spark project to .NET 8.0 and update dependencies Modernize Spark project to .NET 8.0, update dependencies, and add CI/CD automation Nov 21, 2025
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.

Fix build on chore/modernize branch

2 participants