Create a monodevelop for Windows Green Edition (test)

Source: Internet
Author: User
Tags gtk posix

With the maturity of the Mono Project, monodevelop, the preferred development tool on the mono platform, also began its cross-platform plan. According to the plan, monodevelo 2.2 will be fully implemented in * UNIX, windows, run on the Mac system. Today, the official preview version for Mac and Windows is also released. For Windows, the preview version is http://monodevelop.com/download/windows_preview. net framework3.5, and GTK # is required. at present, monodevelop windows has some problems, but this is already very exciting. After all, there is another free and complete Windows version.. NET platform and development environment.

The first prerequisite for making monodevelop a green version is that your system has been installed. net framework3.5, of course, to us. NET developers, this is not a problem naturally, so the key lies in the support of GTK #. Download the installation file from the official website and get the runtime of GTK # After unzipping. It looks like:

This also contains the running environment of GTK +. You only need to add the bin directory path to the system path to support running all GTK ++/GTK # programs. in this way, we have supported the system GTK. then we download the monodevelop MSI file, and then we can see the structure after unzipping, such:

Yes, there are only two directories, which areProgramAnd plug-in directory, at this time we enter the bin directory, and did not find the main program to execute the program, it is really strange to think, why directly undo this file, but this is not a problem, we can consider extracting the installed execution file or compiling a main program by ourselves. This main program is just a simple entry. by viewing the source code, we can get the source code of the main program:
 

Using System;
Using System. Collections. Generic;
Using System. LINQ;
Using System. text;
Using System. diagnostics;
Using Mono. addins;
Using Monodevelop. core;
Using Monodevelop. Ide. Gui;

Namespace Monodeveloprunner {
Class Program {
Static Int Main ( String [] ARGs ){
Bool Flag = False ;
Do {
Try {
Runtime. setprocessname ( " Monodevelop " );
Idestartup startup = New Idestartup ();
Return Startup. Run (ARGs );
} Catch (Exception ){
If ( ! Flag ){
Loggingservice. logwarning ( " Monodevelop failed to start. Rebuilding addins registry. " );
Addinmanager. Registry. Rebuild ( New Leleprogressstatus ( True ));
Loggingservice. loginfo ( " Addin registry rebuilt. Restarting monodevelop. " );
Flag = True ;
} Else {
Loggingservice. logfatalerror ( " Monodevelop failed to start. Some of the assemblies required to run monodevelop (for example GTK-sharp, gnome-sharp or gtkhtml-sharp) may not be properly installed in the GAC. " , Exception );
Flag = False ;
}
} Finally {
Runtime. Shutdown ();
}
}
While (FLAG );
Return - 1 ;
}
}
}

 

Compile this program as the main program of monodevelop.

Put the compiled or extracted main program into the bin directory. However, the main program cannot be executed at this time. If you view the error information, you will find that the system prompts that the gtksharp support file is missing. The simplest way is, copy GTK #'s support for dllcopy to the bin directory. The required files are:

These files can be in the Lib, lib/gtk-sharp-2.0, lib/mono. locate POSIX and other directories. copy these files to the bin directory and run the main program again. You can run the program and test it. However, a system exception occurs when you open a new project, the prompt pango-sharp cannot be loaded, but we have already put the DLL into the bin folder. Why? After searching, we finally found that the exception of the Assembly is libstetic, the Assembly shows the assembly loading the pango-sharp2.8.0, But we download the latest GTK # provided version 2.14.0, therefore, the libstetic source code checkout is required to modify the configuration of this Part and re-compile it (ArticleThe re-edited assembly will be provided below). After the libstetic is modified, no exception is found,

Next, we will test and create a new GTK # program. We found that the GTK # version is empty when the version is supported. After check, this is exactly because we did not use the installation package of GTK, because of the green package, GTK # does not support GAC registration. monodevelop checks GTK # Only the version of GAC, and thus cannot get the correct version number, to solve this problem, we need to modify the registry and add missing information. If the directory of GTK # Running library is E: \ GTK #, you can use the following registry file to modify it, if it is in another directory, you only need to modify the path:
 

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE \ SOFTWARE \ Novell]

[HKEY_LOCAL_MACHINE \ SOFTWARE \ Novell \ gtksharp]

[HKEY_LOCAL_MACHINE \ SOFTWARE \ Novell \ gtksharp \ installfolder]
@="E: \ GTK #\\"

[HKEY_LOCAL_MACHINE \ SOFTWARE \ Novell \ gtksharp \ version]
@="2.12.9"

[HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \. netframework \ assemblyfolders \ gtksharp]
@="E: \ GTK # \ Lib \ gtk-sharp-2.0"

[HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \. netframework \ assemblyfolders \ monocairo]
@="E: \ GTK # \ Lib \ mono. Cairo"

[HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \. netframework \ assemblyfolders \ monoposix]
@="E: \ GTK # \ Lib \ mono. POSIX"

Import the file and create the GTK # program again. Everything is normal. Now, a green monodevelop program is successfully created on different platforms, you only need to modify the path and the GTK # path in the Registry to directly execute monodevelop.

At the end of this article, we provide the re-compiled libstetic assembly.
Click to download this file

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.