Hi,
Actually I'm not changing the mscorlib assembly but it's copy which
allow me to ignore all of the CLR assumptions.
I'll continue using the original mscorlin assembly, all i want is to
have more types which will all have different names then they had in
the original mscorlib assembly and they will be added with some
utility fields.
I already succeed in doing that and i was able to build a valid
assembly except for one last thing that i can't seem to resolve.
The Class System.Object is also defined in mscorlib and it doesn't
extend any class. If i try to use this modified assembly in a freash
VS project then it succeed to build it but when running i get an
excpetion that he can't load the modified System.Object Class (which
has of course a different name then that in the modified assembly). I
tried to modeify this Class also to extend the original System.Object
Class from mscorlib but when i do SaveAssembly it isn't saved and the
Class remain as "BaseType - null".
Can anyone understand why i can't extend this modified Class?
On Oct 31, 1:14 pm, "Lotfi Gheribi" <[EMAIL PROTECTED]> wrote:
> All the primitives : int8/16/32/64, uint8/16/32/64, float32/64, (unsigned)
> native int, string, typedref, object, arrays are for sure special classes.
> Even if they got no explicit unmanaged method associated with them, the JIT
> will treat them in a special manner. You cannot just change them. int32 is
> supposed to be 32 bits, no more ! For instance, every add operation on
> integers would be compiled into a special instruction into the CIL (MSIL)
> code.
>
> But for classes such as ArrayList, List<> and so forth there should be no
> prb (assuming the CLR would let you load the patched mscorlib assembly)
>
> I think instead of changing the mscorlib assembly (which may not be allowed
> by Microsoft), you should rethink your problem.
>
> A solution that might work (but very hard to implement) would be to declare
> a generic type
>
> MySpecialType<T>
> {
> Field _Item :T
> Field myAddedField : int (or any type you want)
>
> }
>
> than you should change every reference to a string, for instance, into a
> reference to MySpecialType<string>.
> Again, this solution would be very hard to implement.
--~--~---------~--~----~------------~-------~--~----~
--
mono-cecil
-~----------~----~----~----~------~----~------~--~---