user979331 user979331 - 1 year ago 102
C# Question

ASP.NET expected ; error

I have this line of code:

var defaultResult = $"Enum_{@this.GetType().Name}_{@this}";

but I get this error:

expected ;

How do I fix this? String.Format?

Answer Source

The $ is a feature available in C# 6.0. Make sure you're set to the correct version.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download