tags:

views:

85

answers:

4

Hi,

For calling MS C# compiler there is CSharpCodeProvider (http://msdn.microsoft.com/en-us/library/microsoft.csharp.csharpcodeprovider.aspx)

but how do I call the Mono compiler?

I want to know if there was any errors after compilation.

+1  A: 

I have not used Mono, but a quick Bing turned up the following Microsoft.CSharp.CSharpCodeProvider in the Mono documentation, is it possible that Mono implements the functionality targeting the Mono C# compiler.

Chris Taylor
Yep, it should be exactly the same. Don't change anything, just use Microsoft.CSharp.CSharpCodeProvider and Mono will do the right thing.
jpobst
A: 

You should take a look at MonoDevelop. It's full featured IDE for the Mono project, speaking of C#, F# and others. You can create a project, generate the classes, paste your source and it'll take care of everything.

Speaking of the compiler: It's called mcs if you exported mono to your PATH. man mcs/mcs --help.

wishi
`mcs` is non-generic C# compiler i.e. for .NET 1.x. `gmcs` is for 2.0+. It's better to man it
abatishchev
A: 

Probably using Microsoft.CSharp.dll from Mono will call Mono's implementation of Microsoft C# compiler which is the same as Microsoft's.

To call Mono specific features of C# compiler use Mono.CSharp.dll

abatishchev
+3  A: 

Mono has a better approach available (which should be provided in .NET 5 probably),

http://tirania.org/blog/archive/2008/Sep-10.html

Lex Li