ildasm.exe wont work

Maksim Maksim 31 Reputation points
2021-04-25T10:32:31.213+00:00

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.

.NET
.NET
Microsoft Technologies based on the .NET software framework.
4,103 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Xingyu Zhao-MSFT 5,371 Reputation points
    2021-05-03T06:41:13.15+00:00

    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.

    2 people found this answer helpful.

  2. LectoreVoC 1 Reputation point
    2021-11-09T11:38:21.053+00:00

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

    147821-image.png

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.