Heres my code where im tryng to override SettingsFileName member:
public class ProcessorTest: Processor
{
public virtual override string SettingsFileName
{
get { return @"C:\Settings.xml"; }
}
}
Heres the class where is the member:
public abstract class Processor
{
/// <summary>
/// Implement this property to enable initializing singleton from the correct file path
/// </summary>
public abstract string SettingsFileName { get; }
}
But this gives me a error:
A member 'ProcessorTest.SettingsFileName' marked as override cannot be marked as new or virtual
What am i doing wrong?
Just use
overridein the inherited class, notvirtual override.virtualmarks a member as overridable, so it’s used in the base class.overridemarks a member as overriding someone overridable.abstractimpliesvirtual.