What does the @ in this mean (I know it’s using an obsolete .NET Framework 1.1 ConfigurationSettings.AppSettings)?
@ConfigurationSettings.AppSettings["some_setting"];
This is NOT a string literal: Using the literal '@' with a string variable
The actual code:
_scale_id_regex = @ConfigurationSettings.AppSettings["ScaleIdRegEx"];
In a regular .cs file which is part of a Windows Service and _scale_id_regex is just a private string in the class, so ASP.NET and Razor are not involved.
It’s called a verbatim identifier. It allows you to name variables after reserved words. e.g.
The code you have is valid, but I don’t believe
@services any real purpose there. Since this got upvoted faster than I could refresh my page, here’s what the ECMA C# Language Specification, section 9.4.2 says.The code you posted is valid because this is allowed by the language specification, albeit discouraged.