You are here

Portable Mono/.NET

1 post / 0 new
Rob Loach
Rob Loach's picture
Offline
Last seen: 15 years 8 months ago
Developer
Joined: 2005-12-09 17:29
Portable Mono/.NET

I was playing around with Mono (an open-source .NET implementation) and decided to try it out as a portable application development suite. I installed it on my computer, copied the files to my USB drive, and tried to hook it up with PSPad (which is already portable). I can now compile C# code from PSPad without any dependancies on .NET being installed.

Compiler Settings
Here are the compiler settings for PSPad I used...
Compiler: drive:pathto\Mono\bin\mcs.bat
Parameters: "%FILE%"
Run After Compilation: drive:pathto\Mono\bin\mono.exe "%DIR%%NAME%.exe"
LOG Parser: %F(%L,%C): error *: *
Checked on "Save All Files Before Compilation", "Capture Program Window" and "Hide Output Window".

Example
To test it out, put in the following code into PSPad, make sure you're using the above compiler settings with the C# highlighter settings and press CTRL + F9...

class HelloWorld
{
    static void Main ()
    {
        System.Console.Write("Hello World!");
        System.Console.ReadLine();
    }
}

The output will give you something like this. If you intentionally write in some errors (like add in some syntax errors), the log window will display them and you can click to be directed to the code errors.

What's Next?
I'd like to find a good portable Mono/.NET IDE that has no dependancies on .NET being installed. Then you could load up the IDE, and compile applications directly without having to worry about making up the correct arguments when working with multiple files.