Having a bit of an issue getting this error to clear when compiling with csc.exe
on Win10. I am very new to C#. Doing a bit of self learning before I start attending classes in Jan.
Following a "TeamTreehouse" tutorial on doing this. They are using mono
in their workspaces. I am preferring to use vscode
on my machine to get familiar with using C# outside of mono.
From what I have read on CS0501 with my issue is that it is a compiler issue that shouldn't be an issue but using csc.exe
is causing an issue. Adding abstract
gives a whole new set of issues.
Command using to compiler from terminal is csc *.cs
I am not sure where to look next for a solution. I haven't been able to find a working one using what is called Auto-Implemented Properties
.
The error is
Invader.cs(6,39): error CS0501: 'TreehouseDefense.Invader.Location.get' must declare a body because it is not marked abstract or extern
Invader.cs(6,52): error CS0501: 'TreehouseDefense.Invader.Location.set' must declare a body because it is not marked abstract or extern
The code Invader.cs
namespace TreehouseDefense {
class Invader {
public MapLocation Location { get; private set; }
}
}
The Project Object_Project.csproj
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.2</TargetFramework>
</PropertyGroup>
</Project>