Skip to content

RFC - Add support for .NetFramework AnyCPU - #64

Open
deAtog wants to merge 7 commits into
hey-red:masterfrom
deAtog:dev
Open

RFC - Add support for .NetFramework AnyCPU#64
deAtog wants to merge 7 commits into
hey-red:masterfrom
deAtog:dev

Conversation

@deAtog

@deAtog deAtog commented Jul 21, 2026

Copy link
Copy Markdown

This pull request adds support for the AnyCPU target in .Net Framework.

The following changes have been made:

  1. Moves the native library wrapper class to it's own Magic assembly.
  2. Moves the native library components to a separate Nuget package.
  3. Adds nuspec files for all generated Nuget packages.
  4. Adds build script to build release versions of Nuget packages.

As a result of these changes, the Mime package now conditionally depends on the Magic.NetFramework package and the Magic.NetStandard packages depending on the target framework of the project. The Magic.NetFramework packages includes transformations to apply to the application's app.config file to load the appropriate version of the Magic library from the appropriate subfolder. These transformations are applied regardless of the platform target when a project targets the .Net Framework to allow side by side installation of native .Net executables and to support the AnyCPU target. The app.config transformations depend on SlowCheetah 2.5.48 which is bundled into the Magic.NetFramework package as a tool. The Magic.NetStandard package does not contain transformations as only Windows supports AnyCPU applications.

I have tested these changes on Windows with .Net Framework only. Additional tests are required to ensure these packages work as expected on other platforms.

Note: The app.config transforms contain the public key signature of the signed libraries. The signature in these files must match the one used to sign the files. If you build release versions of these packages with a custom key.snk then you will need to adjust the signature in these files appropriately. The current signature in these files should match the one currently used by hey-red when publishing the current Mime nuget package.

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.

1 participant