dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
14.63k stars 4.57k forks source link

ILVerify throws System.BadImageFormatException on invoke #71688

Closed qt-kaneko closed 2 years ago

qt-kaneko commented 2 years ago

Description

When ILVerify is invoked it throws Unhandled exception. System.BadImageFormatException: Could not load file or assembly '~/.dotnet/tools/.store/dotnet-ilverify/6.0.0/dotnet-ilverify/6.0.0/tools/net6.0/any/ILVerify.dll'. An attempt was made to load a program with an incorrect format.

Reproduction Steps

1) Install ILVerify with "dotnet tool install --global dotnet-ilverify --version 6.0.0" 2) Run "ilverify"

Expected behavior

Work

Actual behavior

Unhandled exception. System.BadImageFormatException: Could not load file or assembly '~/.dotnet/tools/.store/dotnet-ilverify/6.0.0/dotnet-ilverify/6.0.0/tools/net6.0/any/ILVerify.dll'. An attempt was made to load a program with an incorrect format.

Regression?

No response

Known Workarounds

No response

Configuration

.NET SDK (reflecting any global.json): Version: 6.0.301 Commit: 43f9b18481

Runtime Environment: OS Name: Mac OS X OS Version: 12.4 OS Platform: Darwin RID: osx.12-arm64 Base Path: /usr/local/share/dotnet/sdk/6.0.301/

Host (useful for support): Version: 6.0.6 Commit: 7cca709db2

.NET SDKs installed: 6.0.203 [/usr/local/share/dotnet/sdk] 6.0.300 [/usr/local/share/dotnet/sdk] 6.0.301 [/usr/local/share/dotnet/sdk]

.NET runtimes installed: Microsoft.AspNetCore.App 6.0.5 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.6 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 6.0.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.6 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

Other information

No response

ghost commented 2 years ago

Tagging subscribers to this area: @JulieLeeMSFT See info in area-owners.md if you want to be subscribed.

Issue Details
### Description When ILVerify is invoked it throws Unhandled exception. System.BadImageFormatException: Could not load file or assembly '~/.dotnet/tools/.store/dotnet-ilverify/6.0.0/dotnet-ilverify/6.0.0/tools/net6.0/any/ILVerify.dll'. An attempt was made to load a program with an incorrect format. ### Reproduction Steps 1) Install ILVerify with "dotnet tool install --global dotnet-ilverify --version 6.0.0" 2) Run "ilverify" ### Expected behavior Work ### Actual behavior Unhandled exception. System.BadImageFormatException: Could not load file or assembly '~/.dotnet/tools/.store/dotnet-ilverify/6.0.0/dotnet-ilverify/6.0.0/tools/net6.0/any/ILVerify.dll'. An attempt was made to load a program with an incorrect format. ### Regression? _No response_ ### Known Workarounds _No response_ ### Configuration .NET SDK (reflecting any global.json): Version: 6.0.301 Commit: 43f9b18481 Runtime Environment: OS Name: Mac OS X OS Version: 12.4 OS Platform: Darwin RID: osx.12-arm64 Base Path: /usr/local/share/dotnet/sdk/6.0.301/ Host (useful for support): Version: 6.0.6 Commit: 7cca709db2 .NET SDKs installed: 6.0.203 [/usr/local/share/dotnet/sdk] 6.0.300 [/usr/local/share/dotnet/sdk] 6.0.301 [/usr/local/share/dotnet/sdk] .NET runtimes installed: Microsoft.AspNetCore.App 6.0.5 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.6 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 6.0.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.6 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] ### Other information _No response_
Author: qt-kaneko
Assignees: -
Labels: `area-ILVerification`
Milestone: -
jkotas commented 2 years ago

Duplicate of https://github.com/dotnet/runtime/issues/70508