Web hosting bandwidth - CHAPTER 15 UNDERSTANDING CIL AND THE ROLE
CHAPTER 15 UNDERSTANDING CIL AND THE ROLE OF DYNAMIC ASSEMBLIES 503 Building CILCarClient.exe Now you can build a simple *.exe assembly that will Make a CILCar type. Pass the type into the static CILCarInfo.Display() method. Create a new *.il file and define external references to mscorlib.dll and CILCars.dll (don t forget to place a copy of this .NET assembly in the client s application directory!). Next, define a single type (Program) that manipulates the CILCars.dll assembly. Here s the complete code: // External assembly refs. .assembly extern mscorlib { .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) .ver 2:0:0:0 } .assembly extern CILCars { .ver 1:0:0:0 } // Our executable assembly. .assembly CILCarClient { .hash algorithm 0×00008004 .ver 0:0:0:0 } .module CILCarClient.exe // Implementation of Program type .namespace CILCarClient { .class private auto ansi beforefieldinit Program extends [mscorlib]System.Object { .method private hidebysig static void Main(string[] args) cil managed { // Marks the entry point of the *.exe. .entrypoint .maxstack 8 // Declare a local CILCar type and push // values on the stack for ctor call. .locals init ([0] class [CILCars]CILCars.CILCar myCilCar) ldc.i4 55 ldstr “Junior” // Make new CilCar; store and load reference. newobj instance void [CILCars]CILCars.CILCar::.ctor(int32, string) stloc.0 ldloc.0
In case you need quality webspace to host and run your web applications, try our personal web hosting services.