Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

C# Intermediate C# Polymorphism Virtual Properties

Bug in the "Virtual Properties" task in Intermediate C# course.

There is a bug in this objective, the "Preview" button is nowhere to be seen thus making it impossible to check the console error. Because of that I have no idea what I'm doing wrong in my code.

I'm having the same issue, haven't gotten past the first step even though I'm sure my code is right:

public override string Description => "Detects repetitions";

did you get past the first step?

No I didn't get past the first step, looks like it's impossible. I have tried doing it in every possible way: same as you did (which I'm sure is correct), as an auto property { get; set; } and as a 'regular' property as well. Nothing seems to work, and I can't see what the error is. Bummer :(

1 Answer

Teddy Meng
Teddy Meng
2,558 Points

Make sure that in SequenceDetector.cs the description property is 'public virtual' as well. I had the same error message but when I change public string Description => ""; to public virtual string Description => ""; it works.

Hm, that does work... but I could have sworn that's exactly what I did first!