HighTechTalks DotNet Forums  

IL .override question

Dotnet Framework (CLR) microsoft.public.dotnet.framework.clr


Discuss IL .override question in the Dotnet Framework (CLR) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
AJ
 
Posts: n/a

Default IL .override question - 11-20-2007 , 05:35 AM






I'm trying to resolve an issue where my application doesn't run after
obsfucation using dotfuscator.

I'm looking at the IL output from dotfuscator using reflector, and have
a query..

I've a class that implements a generic interface..

..class public abstract auto ansi beforefieldinit FactoryBase<class
CreatedClass>
extends [mscorlib]System.Object
implements App.IObjectFactory`1<!CreatedClass>
{...}

and it implements one of IObjectFactory's methods:

.method public hidebysig newslot virtual final instance string a(!
CreatedClass A_0) cil managed
{
.override App.IObjectFactory` ::FriendlyNameFor
}



My query is whether this second bit of IL is correct.... In trying to
reproduce the error in another project, I get the alternative:

..override App.IObjectFactory`<!CreatedClass>::FriendlyNameFo r

i.e. it's specifying the generic parameter.


Is either or both correct? I don't know enough IL and haven't yet found
a suitable google reference...


Reply With Quote
  #2  
Old   
Peter Ritchie [C# MVP]
 
Posts: n/a

Default RE: IL .override question - 12-21-2007 , 01:24 PM






Yes, they've both valid. IL like that often depends on the source of the
class as the base being overridden. For example, deriving from a class in
the same assembly and overriding a method will generate different IL from
deriving from a class in a different assembly and overriding a method, even
if the two base classes are textually identical.

Could you detail "doesn't work".
--
Browse http://connect.microsoft.com/VisualStudio/feedback/ and vote.
http://www.peterRitchie.com/blog/
Microsoft MVP, Visual Developer - Visual C#


"AJ" wrote:

Quote:
I'm trying to resolve an issue where my application doesn't run after
obsfucation using dotfuscator.

I'm looking at the IL output from dotfuscator using reflector, and have
a query..

I've a class that implements a generic interface..

..class public abstract auto ansi beforefieldinit FactoryBase<class
CreatedClass
extends [mscorlib]System.Object
implements App.IObjectFactory`1<!CreatedClass
{...}

and it implements one of IObjectFactory's methods:

.method public hidebysig newslot virtual final instance string a(!
CreatedClass A_0) cil managed
{
.override App.IObjectFactory` ::FriendlyNameFor
}



My query is whether this second bit of IL is correct.... In trying to
reproduce the error in another project, I get the alternative:

..override App.IObjectFactory`<!CreatedClass>::FriendlyNameFo r

i.e. it's specifying the generic parameter.


Is either or both correct? I don't know enough IL and haven't yet found
a suitable google reference...



Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.