question

MaksimMaksim-2485 avatar image
0 Votes"
MaksimMaksim-2485 asked SzymonWojciech-1589 answered

ildasm.exe wont work

Hello!
Can somebody help me maybe, I'm trying to use ildasm.exe just to open a simple program Hello World, written on C# in visual studio 2019.
Every time I'm getting the error "Has no valid CLR header and cannot be disassembled".

Have already googled this problem, but didn't found any solution.

dotnet-standard
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @MaksimMaksim-2485 ,
What's the framework version of your program?
Could you provide your Hello World program code here? It will help us make a test.
We are waiting for your update.

0 Votes 0 ·

Framework .NET 5.0


 using System;
    
 namespace sil5
 {
     class Program
     {
         static void Main(string[] args)
         {
             Console.WriteLine("Hello World!");
         }
     }
 }
0 Votes 0 ·

Hi @MaksimMaksim-2485 ,
May I know whether your issue has been solved or not? If not, please share it in here.

0 Votes 0 ·
XingyuZhao-MSFT avatar image
1 Vote"
XingyuZhao-MSFT answered

Hi @Maksim Maksim ,
In my test(.NET 5):

 namespace ConsoleApp_hello
 {
     class Program
     {
         static void Main(string[] args)
         {
             Console.WriteLine("Hello World!");
         }
     }
 }

When using 'ildasm.exe', you need to open '....dll' instead of '....exe'.
93246-1.png
Hope it could be helpful.

Best Regards,
Xingyu Zhao


If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



1.png (73.5 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

SzymonWojciech-1589 avatar image
0 Votes"
SzymonWojciech-1589 answered

Hey, if ildasm.exe doesn't work try write ".dll" instead ".exe".

147821-image.png



image.png (32.4 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.