Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 14. Extending IronPython with C#... > Compiling and using assemblies at ru...

14.3. Compiling and using assemblies at runtime

The code we wrote earlier to wrap native functions for WindowUtils was brief, but having to maintain a separate Visual Studio project and recompile and then copy assemblies across every time we changed the code could be annoying. We can avoid this, and actually eliminate the need to even save binary assemblies at all, by compiling straight from source code into memory!

.NET provides access to the compiler infrastructure, through the System.CodeDom.Compiler namespace[19] in conjunction with an appropriate code provider. Accessing this programmatically from IronPython is straightforward once you know the magic invocations.

[19] See http://msdn.microsoft.com/en-us/library/system.codedom.compiler.aspx.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial