Skip to content

Migration to .NET 10#2872

Draft
ColinM9991 wants to merge 35 commits into
MobiFlight:mainfrom
ColinM9991:feature/dotnet
Draft

Migration to .NET 10#2872
ColinM9991 wants to merge 35 commits into
MobiFlight:mainfrom
ColinM9991:feature/dotnet

Conversation

@ColinM9991

@ColinM9991 ColinM9991 commented Apr 3, 2026

Copy link
Copy Markdown
Contributor

Description

Migrating from .NET Framework to .NET 10 is naturally a massive change, even if not at the surface. There are many changes in the SDK and runtime which improve security, deprecate APIs and some that affect the lower level memory-pinning to yield better performance. The SDK is also less forgiving which raises issues that may not have been observed prior to this migration.

Notable changes

MobiFlight Installer

The installer code is quite tricky to follow and I'm wondering whether it needs to be a standalone application. While .NET Framework produced a single binary, .NET Core compiles the application as a DLL file and also produces an executable that is a wrapper around the dotnet run command which runs the app confined within the DLL. This means the installer is no longer compatible with some of the core logic.

I've applied the following changes

  1. Remove the reading of the user.config files to retrieve the beta flag. This is passed via the /beta by MobiFlight argument instead (Opinion: one app shouldn't be reading the config of another app)
  2. Remove the logic around the installer self updating. The installer hasn't received an update for some time so I don't anticipate much impact from this. We should instead look to replace the installer. Rework and improve MobiFlight Installer #2876

MobiFlight Bundler project

This is a utility project where the sole-purpose is to reference MobiFlightConnector and MobiFlightInstaller so that dotnet publish produces a directory with all of the relevant runtime and reference artifacts.

Dependency Injection

Dependency injection has been added at the entry point via IHostBuilder. MainForm is currently the only service that's registered in the container. This paves the way for improving the testability of the application.

DataSet and DataTable

These types are no longer part of the Windows Forms toolbox in later versions of .NET. These were originally configured incorrectly in that the type of the settings column was specified as typeof(object) while the actual type would be one of OutputConfigItem or InputConfigItem. .NET is more stringent than .NET Framework and the lower level implementation of the DataSet class, particularly with how types are resolved.

Short of redesigning the data loading process, FsuipcConfigPanel has been updated to use XmlSerializer to continue to support the existing functionality for the Presets.aip file

UI Resource duplication

The resource files had a lot of duplicate keys. These have all been removed

TODO

  • Convert MobiFlightConnector to .NET 10
  • Migrate Unit Tests
  • Migrate Installer
  • Update workflow files to use .NET SDK
  • Test hardware and flight simulators

@ColinM9991 ColinM9991 force-pushed the feature/dotnet branch 14 times, most recently from 0f754f8 to 8b9c9ad Compare April 4, 2026 10:28
@github-actions

github-actions Bot commented Apr 4, 2026

Copy link
Copy Markdown

Build for this pull request:
MobiFlightConnector.zip

@ColinM9991 ColinM9991 force-pushed the feature/dotnet branch 2 times, most recently from c015d4c to d3b5db9 Compare April 4, 2026 10:55
@github-actions

github-actions Bot commented Apr 4, 2026

Copy link
Copy Markdown

Build for this pull request:
MobiFlightConnector.zip

@github-actions

github-actions Bot commented Apr 4, 2026

Copy link
Copy Markdown

Build for this pull request:
MobiFlightConnector.zip

@ColinM9991 ColinM9991 force-pushed the feature/dotnet branch 2 times, most recently from 6a3a31d to fc090e1 Compare April 4, 2026 11:28
@github-actions

github-actions Bot commented Apr 4, 2026

Copy link
Copy Markdown

Build for this pull request:
MobiFlightConnector.zip

@github-actions

github-actions Bot commented Apr 4, 2026

Copy link
Copy Markdown

Build for this pull request:
MobiFlightConnector.zip

@github-actions

github-actions Bot commented Apr 4, 2026

Copy link
Copy Markdown

Build for this pull request:
MobiFlightConnector.zip

@github-actions

github-actions Bot commented Apr 4, 2026

Copy link
Copy Markdown

Build for this pull request:
MobiFlightConnector.zip

@github-actions

github-actions Bot commented Apr 4, 2026

Copy link
Copy Markdown

Build for this pull request:
MobiFlightConnector.zip

@github-actions

github-actions Bot commented Apr 4, 2026

Copy link
Copy Markdown

Build for this pull request:
MobiFlightConnector.zip

@github-actions

github-actions Bot commented Apr 4, 2026

Copy link
Copy Markdown

Build for this pull request:
MobiFlightConnector.zip

@github-actions

github-actions Bot commented Apr 4, 2026

Copy link
Copy Markdown

Build for this pull request:
MobiFlightConnector.zip

@github-actions

Copy link
Copy Markdown

Build for this pull request:
MobiFlightConnector.zip

@github-actions

Copy link
Copy Markdown

Build for this pull request:
MobiFlightConnector.zip

@ColinM9991 ColinM9991 marked this pull request as draft April 12, 2026 16:31
@ColinM9991

Copy link
Copy Markdown
Contributor Author

Converted to a draft again as there are some issues with the installer workflow and the fact the installer needs to be able to self-update

@github-actions

Copy link
Copy Markdown

Build for this pull request:
MobiFlightConnector.zip

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