Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot run Verify.Xunit tests on Windows ARM64 #315

Closed
fleed opened this issue Feb 25, 2023 · 11 comments
Closed

Cannot run Verify.Xunit tests on Windows ARM64 #315

fleed opened this issue Feb 25, 2023 · 11 comments

Comments

@fleed
Copy link

fleed commented Feb 25, 2023

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

@SimonCropp
Copy link
Member

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

@SimonCropp
Copy link
Member

can u try v 11.2

@fleed
Copy link
Author

fleed commented Feb 26, 2023

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.

@SimonCropp
Copy link
Member

can u share that issue?

@fleed
Copy link
Author

fleed commented Feb 26, 2023

This: 59844

@toastmastern
Copy link

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 :) )

@SimonCropp
Copy link
Member

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

@toastmastern
Copy link

toastmastern commented Mar 2, 2023

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?

@SimonCropp
Copy link
Member

can u try v 11.3.0

@matkoch
Copy link

matkoch commented Apr 13, 2023

Works for me

@fleed
Copy link
Author

fleed commented Apr 14, 2023

Works perfectly! Thank you so much @SimonCropp !

@fleed fleed closed this as completed Apr 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants