Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 164607
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T11:46:27+00:00 2026-05-11T11:46:27+00:00

Using ildasm and a C# program e.g. static void Main(string[] args) { } gives:

  • 0

Using ildasm and a C# program e.g.

static void Main(string[] args) {  } 

gives:

.method private hidebysig static void  Main(string[] args) cil managed {   .entrypoint   // Code size       2 (0x2)   .maxstack  8   IL_0000:  nop   IL_0001:  ret } // end of method Program::Main 

What does the hidebysig construct do?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T11:46:27+00:00Added an answer on May 11, 2026 at 11:46 am

    From ECMA 335, section 8.10.4 of partition 1:

    The CTS provides independent control over both the names that are visible from a base type (hiding) and the sharing of layout slots in the derived class (overriding). Hiding is controlled by marking a member in the derived class as either hide by name or hide by name-and-signature. Hiding is always performed based on the kind of member, that is, derived field names can hide base field names, but not method names, property names, or event names. If a derived member is marked hide by name, then members of the same kind in the base class with the same name are not visible in the derived class; if the member is marked hide by name-and-signature then only a member of the same kind with exactly the same name and type (for fields) or method signature (for methods) is hidden from the derived class. Implementation of the distinction between these two forms of hiding is provided entirely by source language compilers and the reflection library; it has no direct impact on the VES itself.

    (It’s not immediately clear from that, but hidebysig means ‘hide by name-and-signature’.)

    Also in section 15.4.2.2 of partition 2:

    hidebysig is supplied for the use of tools and is ignored by the VES. It specifies that the declared method hides all methods of the base class types that have a matching method signature; when omitted, the method should hide all methods of the same name, regardless of the signature.

    As an example, suppose you have:

    public class Base {     public void Bar()     {     } }  public class Derived : Base {     public void Bar(string x)     {     } }  ...  Derived d = new Derived(); d.Bar(); 

    That’s valid, because Bar(string) doesn’t hide Bar(), because the C# compiler uses hidebysig. If it used ‘hide by name’ semantics, you wouldn’t be able to call Bar() at all on a reference of type Derived, although you could still cast it to Base and call it that way.

    EDIT: I’ve just tried this by compiling the above code to a DLL, ildasming it, removing hidebysig for Bar() and Bar(string), ilasming it again, then trying to call Bar() from other code:

    Derived d = new Derived(); d.Bar();  Test.cs(6,9): error CS1501: No overload for method 'Bar' takes '0' arguments 

    However:

    Base d = new Derived(); d.Bar(); 

    (No compilation problems.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 129k
  • Answers 129k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Note that this iterates over the dictionary (rather than using… May 12, 2026 at 5:56 am
  • Editorial Team
    Editorial Team added an answer Alright, so I figured it out. My local machine was… May 12, 2026 at 5:56 am
  • Editorial Team
    Editorial Team added an answer poly's values will be copied into _poly -- but you… May 12, 2026 at 5:56 am

Related Questions

When I do a clean build my C# project, the produced dll is different
Help! I have a clickonce app built and published using .Net 2.0. This app
This is a question about the VB.NET language. Since I am using it every
I've been trying to use the WPF toolkit in a WPF application that I'm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.