This is a mirror of official site: http://jasper-net.blogspot.com/

3 Gems in Mono for .NET Programmers – The hidden potential of Mono.CSharp, Mono.Cecil And Mono.TextTemplating

| Sunday, October 17, 2010
Mono is getting more mature. I should say, Mono guys are even outshining their Microsoft counterparts in some areas. For example, Mono’s C# compiler already supports Compiler as a Service. In this post, we’ll have a quick look at some interesting Mono libraries that you can use in your .NET projects, to take advantage of some of their functionalities, that is not present in the .NET stack.

1 - Mono.CSharp – For Compiler as a Service and C# as a scripting language
Anders in his C# Futures Talk mentioned about C# Compiler as a Service and demonstrated an REPL (Read Evaluation Print Loop) implementation. And few months back, I got pretty surprised when I found that Mono announced Compiler as a Service support. This will enable you to evaluate C# code on the fly, and more importantly, to use C# as a scripting language in your applications. Here is a step by step guide to this feature.

  • Hosting Mono’s C# Compiler As a Service in .NET Apps
  • Dynamic Filtering and Querying in .NET Applications
  • Using C# as a scripting language

2 - Mono.TextTemplating – For T4 (Text Templating) Functionality in your .NET applications
In a lot of scenarios, a custom text template processor comes in handy. I remember putting together a simple, custom Text template processor some time back for generating Emails. With in Visual Studio, there is a Text Templating transformation engine built in, better known T4. It is used for a lot of scenarios, mainly for generating code from Models, and is used in various VS Packages for code generation purposes. You can also write your own Template files (*.tt) with in Visual Studio, and Clarius has a cool T4 Editor available for Visual Studio.
All is good. But what if you want to implement some templating functionality in your own applications? We can’t use the Microsoft.VisualStudio.TextTemplating libraries, because I don't believe that T4 can be legally redistributed without Visual Studio. But you can rely on Mono equivalent T4 implementation,Mono.TextTemplating

Read more: amazedsaint's .net journal

Posted via email from .NET Info

0 comments: