'Where is the PEVerify equivalent in.NET Core for Mac and Linux?

In .Net Framework the PEVerify determines whether the IL code of a .Net module meets type safety requirements.

What is the equivalent tool in .NET Core that produces the same kind of verification?



Solution 1:[1]

The official alternative to PEVerify.exe for .net core apps and beyond is to use ILVerify. You can install it via the command line:

dotnet tool install --global dotnet-ilverify

Sample provided by Microsoft:

dotnet ilverify hello.dll -r "c:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.1.12\*.dll"

Note that unlike PEVerify, you must supply all the references on the command line (including the framework assemblies), so if the assembly you are trying to verify references other assemblies in your project, you'll need to reference those too by adding more -r switches to the command.

Official documentation here

Thanks to Hans Passant for the five year old comment to the question that led me to this solution.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1