What is base. ctor (); In C #?

Source: Internet
Author: User

I am disassembling some C # applications and I am trying to reconstruct the source code. I am disassembling the application along with the required DLLs.
I keep coming across this line base..ctor(); which gives me an error. The line occurs in some voids with in some subclasses of Stream and Exception .

Does anyone has any idea what the code should is? I am thinking the disassembler messed it up some what and it is clearly invalid code. So does anyone know what's it is meant to mean and how can I change the line so it works?

Here is the code of the one of the subclasses. Occurs in:

 [Guid (    ]  public  class   zlibexception:exception{ public   Zlibexception () { base  .        ctor ();     return  ;  public  zlibexception (string  Span style= "color: #000000;" > s) { base  .        ctor ();     return  ; }}

It should be:

[Guid ("ebc25cf6-9120-4283-b972-0e5520d0000e")]  Public class zlibexception:exception{    publicbase()    {        return ;    }      Public Zlibexception (stringbase()    {        return;    }}

Which calls the constructor with that signature on the base implementation of this class.

But by default the. NET CLR calls the base, blank constructor for your, so you don ' t actually need the: base()

Original address: Http://stackoverflow.com/questions/18150628/what-is-base-ctor-in-c

What is base. ctor (); In C #?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.