I've been looking at some code in a debugger associated with Razor View engine and I noticed that some of the types appear in Debugger with a trailing dot character at the end of the type name e.g.:
{Nancy.ViewEngines.Razor.RazorViewEngine.}
Does anyone know what this indicates? It's not valid syntax to use it when specifying a cast on an object so I'm intrigued as to what it indicates within the debugger.
EDIT: As requested by @Damien_The_Unbeliever, screenshot of the variable in debugger:
And the code that I'm looking at:
public TCompiledView GetOrAdd<TCompiledView>( ViewLocationResult viewLocationResult, Func<ViewLocationResult, TCompiledView> valueFactory) { TCompiledView compiledView = default(TCompiledView); compiledView = (TCompiledView)this.cache.GetOrAdd(viewLocationResult, x => valueFactory(x));
To give a little more background, we're trying to add logging to our Nancy View Cache to investigate an intermittent issue with Razor Views throwing compilation errors, but that isn't really relevant to the question.
The trailing dot is the part of the FQDN, it means the “root zone” in the internet domain name hierarchy system. So from top to bottom is “the dot” means the root, and the top level domain for example “com” or “org”, then the company or organization domain name “google”, and subdomain “www”.
Cedilla. The cedilla is the diacritical mark ( ̧ ) that is placed under the letter 'c,' as in the spelling of the French words façade and garçon, to indicate that the letter is to be pronounced \s\, rather than \k\.
Some domain providers require a dot at the end of a CNAME record value. If the user then does not add it the domain itself would be added to the value.
The trailing dot tells the DNS server that this is a fully qualified name. The dot is the root of the DNS heirarchy. If you don't use the dot, the DNS server will assume that it's a record in the current zone and will append it for you. For example, if you have a CNAME in exmaple. com that points to host. example.
Technically the "." on the end of a record such as www.serverfault.com. indicates the separator between the "com" gTLD and the "" root zone. Show activity on this post. The trailing dot tells the DNS server that this is a fully qualified name. The dot is the root of the DNS heirarchy.
The original designers wanted to be able to specify hosts in zone files with a minimum of typing, therefore it defaults to appending the zone to each entry unless fully qualified with a trailing dot. This is an implementation quirk that everydns.net realizes leads to newbie errors and confusion; therefore they eliminated it.
No, the dot at the end is correct. You can try it here. Try adding a dot at the end of "www.dns-sd.org", as shown in the subtitle at the top of this page, and you should still get the same page. It's a little-known fact, but fully-qualified (unambiguous) DNS domain names have a dot at the end.
I've seen this happen when the variable/value is actually of a compiler generated type (e.g. for holding the "local variables" captured by a lambda, async, iterator, etc). The debugger (in various places) seems unable to display the actual class name.
E.g. this example program:
class Program { static void Main(string[] args) { var p = new Program(); p.DoStuff(); } void DoStuff() { int i = 19; Expression<Func<int>> j = () => i + 10; var k = (((j.Body as BinaryExpression).Left as MemberExpression).Expression as ConstantExpression).Value; Console.ReadLine(); } }
With a breakpoint on Console.ReadLine()
, you'll find the k
class's type looks like Program.
rather than Program+<>_DisplayClass0
Addition by Jeppe: This example is a slight simplification of the above, avoiding the expression tree. Looks at a delegate instance's Target
which will be an instance of a generated class. For comparison also looks at an iterator block type:
using System; using System.Collections.Generic; static class Program { static void Main() { int i = 19; // to be captured by lambda, will become field on a generated class Func<int> f = () => i; var target = f.Target; // when debugging type looks like "Program." Console.WriteLine(target.GetType().ToString()); // writes "Program+<>c__DisplayClass1" var seq = GetSeq(); // when debugging type looks like "Program.GetSeq" Console.WriteLine(seq.GetType().ToString()); // writes "Program+<GetSeq>d__3" } static IEnumerable<int> GetSeq() // returns "state machine" (iterator block) { yield return 42; } }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With