How to Deploy .Net Applications to the Linux Platform With Confidence Using Mono With Delphi Prism
Method 1 of 3:
Setting Up
- Install Delphi Prism XE after downloading, in the same manner you would install any Windows Application.
- Set up the VM. Launch VMware Player / VirtualBox and create an OpenSuSe based VM. Install the ISO that you downloaded from the location.
- Boot off the Live CD then choose Install. The recommended install is to have a Swap Space of twice your Physical Memory and the remaining can be allocated to / (root) partition.
- Once installed, reboot the VM and login with your credentials.
Method 2 of 3:
Building a Simple Notepad Application in Delphi Prism and Deploying it to the Mono Appliance
- Launch Delphi Prism by clicking on Start --> All Programs --> Delphi Prism in Visual Studio 2010. Ensure that you run Visual Studio as an Administrator.
- Click on File --> New Project and choose Windows Forms Applications (Mono), under the Mono section.
- From the Toolbox --> Drag and Drop the following controls onto the Form:
- MenuStrip
- ToolStrip
- StatusStrip
- StatusStrip
- ContextMenuStrip
- RichTextBoxControl
- For the MenuStrip and ToolStrip controls, set to insert standard items. Dock the Rich Textbox Control.
- For the ContextStrip Menu, add the following three items:
- Cut
- Copy
- Paste
- Write some code to implement a simple Cut, Copy and Paste functionality.
[Cut Action]
method Mainform.cutToolStripMenuItem1_Click(sender: System.Object; e:
System.EventArgs);
begin
richTextBox1.Cut;
end;
[Copy Action]
method MainForm.copyToolStripMenuItem1_Click(sender: System.Object; e:
System.EventArgs);
begin
richTextBox1.Copy;
end;
[Paste Action]
method MainForm.pasteToolStripMenuItem1_Click(sender: System.Object; e:
System.EventSrgs);
begin
richTextBox1.Paste;
end;
end. - Bind the ContextMenuStrip to the Rich Textbox and copy and paste the above code for the respective actions, in the ContextMenu Strip.
- Press F5 and run the Application.
- Type some text and right click to launch the Context Menu.
- Verify that you are able to perform the required functions, and close the application.
Method 3 of 3:
Deploying the SimpleNotepad to Linux
- As you have the Mono Appliance running, ensure that VMWare Tools are installed on it.
- Navigate to the Debug folder of your project. The path would be similar to something as shown below:
C:UsersUsernameDocumentsvisual studio 2010ProjectsSimple NotepadSimple NotepadbinDebug - Copy the Simple_Notepad.exe to the Mono Appliance Desktop.
- Ensure that the Application does not have any dependencies in running successfully within the Mono Environment. To test this, click on Computer, and choose MOMA - Mono Migration Analyzer.
- Click Next to continue.
- Click on the (+) button and add the Simple_Notepad.exe to the Analyzer.
- Click Next to continue. It will start scanning the assemblies, needed for a successful launch.
- You would be able to see whether the MOMA tool has found any errors or success rate.
- Launch a Terminal window, and run the following command:
mono Simple_Notepad.exe - After running, you can see the application running without any problems.
4 ★ | 1 Vote