Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unexpected character error in C# dot net application [closed]

Tags:

c#

I have a solution created in C#. i have a piece of code in it base.\u002Ector();. When i try to build the application from Visual Studio I am getting the Following error.

Unexpected character '\u002E'

like image 415
Sreejith Unnikrishnan Avatar asked Jan 23 '14 11:01

Sreejith Unnikrishnan


1 Answers

Remove \u002E and you're done!

002E is a full stop or just a dot ('.').

Your code must look like:

base.ctor();

It could happen because of transmitting a program source through different websites/programs with unsupported or broken encoding.

Moreover, ctor is a shortcut for constructor. Make sure you call constructor of base class correctly.

public class Animal
{
    public Animal()
    {
    }
}

public class Cat : Animal 
{
    // next line will be converted to
    // base.ctor() by compiler

    public class Cat() : base()
    {
    }
}

Try to remove base.ctor(); in order to make your class work. I think it should work because your base class has no parameters in constructor.

like image 102
Roman Pushkin Avatar answered Sep 28 '22 07:09

Roman Pushkin