Cook Computing

CIL Programming

October 5, 2002 Written by Charles Cook

Peter Drayton recently made some Observations on CIL books. He summed them up very well. For most developers I think CIL Programming: Under the Hood of .NET would be the best buy because its an introductory text and is much more readable as a result. It contains a lot of detail on Reflection.Emit which is proving very useful in the XML-RPC.NET work I'm doing this weekend: implementing code to automatically generate XML-RPC.NET proxies. Judging from the emails I've replied to over the last few months implementing a proxy causes the most problems and the new proxy generator will make this much easier. Define an interface to represent the XML-RPC end-point and then use it to generate a proxy. Using the proxy generator will look something like this:

interface IFoo
  int Add(int a, intb);

IFoo fooProxy = XmlRpcProxyGen.Create(typeof(IFoo), "http://localhost/math.rem");
int result = fooProxy.Add(1, 2);

Alternatively it will be possible to save the proxy to disk as an assembly. So far I've got a prototype of the generator working and I'm now working out the details of how it will fit into the XML-RPC.NET library.