4

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.

2

4 Answers 4

4

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

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

Sign up to request clarification or add additional context in comments.

Comments

2

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.

1 Comment

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

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.

2 Comments

mcs is non-generic C# compiler i.e. for .NET 1.x. gmcs is for 2.0+. It's better to man it
While abatishchev was 100% correct at the time, 'mcs' is now (as of Mono 2.10) a runtime independent version of the Mono compiler without these limitations. The old 'mcs' (which targeted the .NET 1.1 profile) has been retired.
0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.