Red Gate forums :: View topic - what are <-Cannon> .ctor etc means when I get result
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
ANTS Performance Profiler 7
ANTS Performance Profiler 7 forum

what are <-Cannon> .ctor etc means when I get result

Search in ANTS Performance Profiler 7 forum
Post new topic   Reply to topic
Jump to:  
Author Message
hyang



Joined: 16 Aug 2012
Posts: 11

PostPosted: Thu Mar 14, 2013 4:57 pm    Post subject: what are <-Cannon> .ctor etc means when I get result Reply with quote

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
View user's profile Send private message
jessica.ramos



Joined: 23 Apr 2012
Posts: 215

PostPosted: Fri Mar 15, 2013 7:13 pm    Post subject: Reply with quote

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
View user's profile Send private message
dene.boulton



Joined: 12 Oct 2011
Posts: 53
Location: Cambridge

PostPosted: Mon Mar 18, 2013 2:55 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
hyang



Joined: 16 Aug 2012
Posts: 11

PostPosted: Wed Mar 20, 2013 6:41 pm    Post subject: Reply with quote

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
View user's profile Send private message
dene.boulton



Joined: 12 Oct 2011
Posts: 53
Location: Cambridge

PostPosted: Wed Mar 20, 2013 11:04 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Reply to topic 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