Project

Profile

Help

Bug #5403

open

SaxonCS NuGet SaxonCS.dll is for Amd64 processor architecture and that way doesn't work with Arm64 processors like Apple M1 and .NET 6

Added by Martin Honnen 9 months ago. Updated 8 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Build and release
Sprint/Milestone:
Start date:
2022-03-16
Due date:
% Done:

0%

Estimated time:
Legacy ID:
Applies to branch:
11
Fix Committed on Branch:
9.4, 9.5, 9.6
Fixed in Maintenance Release:
Platforms:
.NET

Description

Based on my problems to use SaxonCS 11.2 from NuGet with .NET 6 on an Apple Mini M1 where any app fails with a "Unhandled exception. System.BadImageFormatException: Could not load file or assembly 'SaxonCS, Version=11.2.0.0, Culture=neutral, PublicKeyToken=null'. An attempt was made to load a program with an incorrect format." for SaxonCS.dll I file this bug to hopefully in the future have a SaxonCS for any CPU or MSIL or a dedicated .NET 6 package.

A simple .NET 5 console application using the NuGet package of SaxonCS 11.2 and outputting the processor architecture rom the assembly is

using System;

namespace SaxonCSAssemblyInspection
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine(".NET {0}, OS {1}, 64bit {2}", Environment.Version, Environment.OSVersion, Environment.Is64BitOperatingSystem);

            var saxonCSInfo = System.Reflection.AssemblyName.GetAssemblyName("SaxonCS.dll");

            Console.WriteLine(saxonCSInfo.ProcessorArchitecture);
        }
    }
}

and outputs on a Mac M1

.NET 5.0.15, OS Unix 11.6.4, 64bit True
Amd64

If I add

            var xmlResolverInfo = System.Reflection.AssemblyName.GetAssemblyName("XmlResolver.dll");

            Console.WriteLine(xmlResolverInfo.ProcessorArchitecture);

that shows "MSIL".

Based on that I think it is not possible to use SaxonCS with .NET 6 on an M1 as the NuGet SaxonCS.dll targets only Amd64 and I think that should be fixed as .NET 6 is the long term .NET release and current/future packages integrate with .NET 6.

Please register to edit this issue

Also available in: Atom PDF