Skip to content

Cannot run Verify.Xunit tests on Windows ARM64 #315

Closed

Description

@fleed

Describe the bug

I have a .NET 6 Xunit test project that uses the package Verify.Xunit (version 19.10.0).

Other relevant versions:

  • Microsoft Visual Studio Enterprise 2022 (ARM 64-bit) 17.4.4
  • xunit 2.4.2
  • xunit.runner.visualstudio 2.4.5

I'm running on Windows ARM64 (under Parallels, M1 MacBook Pro).

I'm using a basic test:

[UsesVerify]
public class VerifyTests
{
    [Fact]
    public async Task TestVerify()
    {
        var result = true;
        await Verifier.Verify(result);
    }
}

It fails with the following exception:

  Message: 
System.TypeInitializationException : The type initializer for 'DiffEngine.ProcessCleanup' threw an exception.
---- System.TypeInitializationException : The type initializer for 'System.Management.ManagementPath' threw an exception.
-------- System.TypeInitializationException : The type initializer for 'System.Management.WmiNetUtilsHelper' threw an exception.
------------ System.ComponentModel.Win32Exception : Failed to load required native library 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\wminet_utils.dll'.

I cannot find information regarding the compatibility with the ARM64 architecture

Activity

  1. SimonCropp commented on Feb 25, 2023

    @SimonCropp
    Member

    out of curiosity, why didnt you try and fix it?

  2. SimonCropp commented on Feb 26, 2023

    @SimonCropp
    Member

    can u try v 11.2

  3. fleed commented on Feb 26, 2023

    @fleed
    Author

    Hi Simon, thank you for support.

    I tried version 11.2, but I'm getting the same error.

    I hoped that it was a quick fix, but it doesn't seem so. I looked at the code and then did some search - found open issues in the dotnet runtime regarding System.Management.ManagementObjectSearcher not working for ARM64.

  4. SimonCropp commented on Feb 26, 2023

    @SimonCropp
    Member

    can u share that issue?

  5. fleed commented on Feb 26, 2023

    @fleed
    Author

    This: 59844

  6. toastmastern commented on Feb 28, 2023

    @toastmastern

    Hi, followed the discussion above and the bug filed to dotnet/runtime
    Is it possible to move from WMI to NtQueryInformationProcess and find command line from the PEB? (perhaps for ARM64 only)
    Or wait for dotnet to fix their issue?

    (i can give it a try if PRs are welcome? need to get the green dots to be considered senior dev :) )

  7. SimonCropp commented on Mar 1, 2023

    @SimonCropp
    Member

    @toastmastern a PR that omits the WMI code on ARM64 would be greatly appreciated

  8. toastmastern commented on Mar 2, 2023

    @toastmastern

    Will give it a try, have had a bit shortage in hours :) noted that dotnet seems to be lack of supporting Framework64 path, might be better to give them a day or two to solve it?

  9. SimonCropp commented on Apr 12, 2023

    @SimonCropp
    Member

    can u try v 11.3.0

  10. matkoch commented on Apr 13, 2023

    @matkoch

    Works for me

  11. fleed commented on Apr 14, 2023

    @fleed
    Author

    Works perfectly! Thank you so much @SimonCropp !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions