| Author |
Message |
hyang
Joined: 16 Aug 2012 Posts: 11
|
Posted: Thu Mar 14, 2013 4:57 pm Post subject: what are <-Cannon> .ctor etc means when I get result |
|
|
Hi,
When I run performance profiler and output data to csv or excel. I saw some very weird words added into method names such as
<Startup>b__3<__Canon>()
Startup()
It<__Canon>(Func<T>)
ResolveAll<__Canon>()
<ResolveAll>b__9<__Canon>()
ResolveAllServices()
<Initialize>b__2<__Canon>()
Initialize()
TryResolveAll<__Canon>()
CreateShell(bool isVisible)
.ctor(IContainer container)
what does ".cctor()", or <_Canon> or b_numbers means
does any body know? or where i can find reference for these? is that possible to show as my normal methods names?
Thanks |
|
| Back to top |
|
 |
jessica.ramos
Joined: 23 Apr 2012 Posts: 76
|
Posted: Fri Mar 15, 2013 7:13 pm Post subject: |
|
|
Hello and thank you for your post!
When you see cctor() method in the results, it essentially means that the method is a constructor
I'm not so sure about <_Canon> or b_numbers -- did these methods come from an assembly that you do not have source for and used the integrated "decompile" option on? _________________ Jessica Ramos
Technical Support
Red Gate Software Ltd. |
|
| Back to top |
|
 |
dene.boulton
Joined: 12 Oct 2011 Posts: 50 Location: Cambridge
|
Posted: Mon Mar 18, 2013 2:55 pm Post subject: |
|
|
System.__Canon is an internal mscorlib type used to make the canonical instantiation of a generic type.
b_ is a compiler generated backing field.
Simple example:
Public string MyString { get; set; }
so becomes something like:
private string b_MyString;
public string get_MyString() { return b_MyString; }
public void set_MyString(string value) { b_MyString = value; } _________________ Dene Boulton
Red Gate |
|
| Back to top |
|
 |
hyang
Joined: 16 Aug 2012 Posts: 11
|
Posted: Wed Mar 20, 2013 6:41 pm Post subject: |
|
|
Thanks a lot for reply.
what about these in the "class"
ConfigService+<>c__DisplayClass10
ConfigService+<>c__DisplayClass16
ConfigService+<>c__DisplayClass5<T>
ConfigService+<>c__DisplayClassd
what do these mean? thanks a lot |
|
| Back to top |
|
 |
dene.boulton
Joined: 12 Oct 2011 Posts: 50 Location: Cambridge
|
Posted: Wed Mar 20, 2013 11:04 pm Post subject: |
|
|
Those are also compiler generated classes; for certain code the compiler needs to introduce actual constructs for things like classes, backing fields, variables etc.
Examples of when this is done are: lamba functions, anonymous functions, for keywords like Async and yield.
<> is used at the start of the generated construct names to avoid any collisions with "defined" code; <> is reserved for the compiler for this very purpose. _________________ Dene Boulton
Red Gate |
|
| Back to top |
|
 |
|
|
All times are GMT + 1 Hour
|
| Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group