AutoIt meets .NET Common Language Runtime (CLR) Framework

CLR : The Common Language Runtime (CLR) is a an Execution Environment .

Common Language Runtime (CLR)’s main tasks are to convert the .NET Managed Code to native code, manage running code like a Virtual Machine, and also controls the interaction with the Operating System.

As part of Microsoft’s .NET Framework, the Common Language Runtime (CLR) is managing the execution of programs written in any of several supported languages.

Allowing them to share common object-oriented classes written in any of the languages.

 

Appdomain : To access the CLR environment you need to create an Appdomain Object.

An AppDomain provides an isolated region in which code runs inside of an existing process.

Application domains provide an isolation boundary for security, reliability, and versioning, and for unloading assemblies.

Application domains are typically created by runtime hosts, which are responsible for bootstrapping the common language runtime before an application is run.

 

CLR Runtime Hosts : When would you use CLR Runtime Hosts.

1. To access .NET Class Libraries :

  • System
  • System.Collections
  • System.Data
  • System.Drawing
  • System.IO
  • System.Text
  • System.Threading
  • System.Timers
  • System.Web
  • System.Web.Services
  • System.Windows.Forms
  • System.Xml

2. Accessing custom build .Net Assemblies :

Some Examples (but there are a ton out there)

  • AutoItX3 – The .NET Assembly for using AutoItX
  • JSonToXML libr.
  • XMLRPC Libr.
  • .NETPDF libr.
  • .NETOCR Libr
  • WInSCP Libr.

    3. To Compile .Net Code into an Assembly at Runtime

    4. To Run C# or VB.net Code at Runtime

    5. To Mix AU3 and .Net functionality in your Application

 

Documentation : Where to find info about CLR hosting

First of all you can find a lot on MSDN relating to .Net CLR Hosting and of course here :

AutoIt .NET CLR Framework

 

Examples : All examples are included in the above thread of the AutoIt forum.

1. To access .NET Class Libraries :

    Example : “System.Text.UTF8Encoding”

    image

    Example : “System.IO.FileInfo”

    image

    Example : “System.Windows.Forms”

    image

 

2. Accessing custom build .Net Assemblies :

    Example : AutoItX3 .NET Assembly using AutoItX

    image

 

3. To Compile .Net Code into an Assembly at Runtime

    Example : Compile Code C# and Code VB

    image

 

4. To Run C# or VB.net Code at Runtime

    Example : Compile Code C# at Runtime

    image

 

5. To Mix AU3 and .Net functionality in your Application

All of the above Examples have a mix of au3 functionality and .Net CLR code

 

This CLR.au3 UDF makes a bridge between .Net and Au3, which give a new dimension to our scripting experience.

Enjoy !

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: