all groups > dotnet clr > november 2007 >
You're in the

dotnet clr

group:

IL .override question


IL .override question AJ
11/20/2007 10:35:21 AM
dotnet clr:
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>::FriendlyNameFor

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...
RE: IL .override question Peter Ritchie [C# MVP]
12/21/2007 10:24:02 AM
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#


[quoted text, click to view]
AddThis Social Bookmark Button