SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

Problem with auto property

Last post 02-15-2017 4:55 PM by Gary Shelton. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 02-14-2017 3:45 PM

    Problem with auto property

    SharpDevelop 5.1.0

    Target Framework: 4.5.2

    I am getting this error:

    'Compilation.Dimentions.Width.get' must declare a body because it is not marked abstract or extern. Automatically implemented properties must define both get and set accessors. (CS0840) - C:\Users\Gary\Documents\SharpDevelop Projects\Compilation\Compilation\Dimentions.cs:18,28

    public class Resolution
        {
            public int Height { get; }
            public int Width { get; }
                    
            public Resolution(int Height, int Width)
            {
                this.Height = Height;
                this.Width = Width;
            }
        }

    This code works fine in Visual Studio, what am I missing?

  • 02-15-2017 4:55 PM In reply to

    Re: Problem with auto property

    Found problem 2 fold. SharpDevelop is only at C# 4.0?. After finding that I saw it was the same problem in another usit so frustrated that fixes didn't work until I applied them to both units.

     

    Is there any way to determine what version of C# enviroment is using?

Page 1 of 1 (2 items)
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.