dotgnu-pnet
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pnet-developers] Compare Microsoft.NET and Portable.NET part2 Emit name


From: Dmitriy
Subject: [Pnet-developers] Compare Microsoft.NET and Portable.NET part2 Emit namespace
Date: Tue, 6 Apr 2004 18:11:44 +0600

Emit.cs and Emit2.cs was get from PNET\samples\simple\emit.cs

and it was slightly modified to run under Microsoft without exception.
But i found principial difference in string:
modBuilder = asmBuilder.DefineDynamicModule(name+"Module");//for
Portable.NET
modBuilder = asmBuilder.DefineDynamicModule(name+"Module",name+".exe");//for
Microsoft
Emit.cs is works perfectly under Portable.NET but under Microsoft.NET it
without any exception generate MyEmitTest.exe but main module is NOT present
in MyEmitTest.exe
PNET\samples\simple>ildasm MyEmitTest.exe
// Input: MyEmitTest.exe
// Image type: EXE
// Native code present: No
// 32-bit only: No
// Length of IL data: 1024

.assembly MyEmitTestAssembly
{
        .hash algorithm 0x00008004
        .ver 0:0:0:0
}
.module RefEmit_OnDiskManifestModule
// MVID: {02F31E17-68E9-4092-9409-4665EFB70722}

Emit2.cs is not run under Portable.NET with exception
PNET\samples\simple>ilrun a.exe
Uncaught exception: System.NotSupportedException: External module files are
not supported
        at
System.Reflection.Emit.AssemblyBuilder.DefineDynamicModule(String, String,
Boolean) in ./
System/Reflection/Emit/AssemblyBuilder.cs:210
        at
System.Reflection.Emit.AssemblyBuilder.DefineDynamicModule(String, String)
in ./System/Re
flection/Emit/AssemblyBuilder.cs:204
        at XYZ.xyz(String)
        at XYZ.Main()

other corrected by me incompatipatibilities you can find in source :
//  localX.SetLocalSymInfo("x"); //ERROR Microsoft.NET required Debug
Builder to do this

class1.cs is not work under Portable.NET :
ilrun a.exe
---
Uncaught exception: System.EntryPointNotFoundException: Entry point was not
found
        at System.Reflection.ClrConstructor.Invoke(BindingFlags, Binder,
Object[], CultureInfo)
        at System.Reflection.ConstructorInfo.Invoke(Object[]) in
./System/Reflection/ConstructorInfo
.cs:61
        at TestILGenerator.Main() in Class1.cs:166

aVector1 = myDTctor.Invoke(aVargs1);//crash string for Portable.NET ....

sample was got from msdn


I need Emit to make runtime wrapper that supports several plugin interfaces
which unknown on compile time, each plugin is not know about other plugin
interfaces.

Please help me!!!.

Attachment: Emit.cs
Description: Text document

Attachment: Emit2.cs
Description: Text document

Attachment: Class1.cs
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]