I am new to C#, I am learning it and it is just a dummy test program. I am getting the error that is mentioned in the title of this post. Below is the C# code.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
namespace DriveInfos
{
class Program
{
static void Main(string[] args)
{
Program prog = new Program();
prog.propertyInt = 5;
Console.WriteLine(prog.propertyInt);
Console.Read();
}
class Program
{
public int propertyInt
{
get { return 1; }
set { Console.WriteLine(value); }
}
}
}
}