Use mono to run the. NET program out of the. NET Framework

Source: Internet
Author: User

Original article: http://www.cnblogs.com/daylight/archive/2008/10/02/1303037.html

It is actually used for mono's public language runtime. The advantage of this is that the release is free of installation. First, you need to download the latest mono version (currently 2.0.1 ). Bytes.

1. Use Visual Studio to create a Windows application named winapp and add a button.

2. compile the project to a winapp.exe file.

3. Create a winapp folder, and create the bin and Lib folders.

4. copy the files in the bin and Lib subfolders of the mono installation folder to the two folders you just created. The default mono installation path is c: \ Program Files \ mono-2.0.

5. Add the EXE file to the winapp folder.

6. Call, which can be called by using bat batch processing, bin \ mono.exe winapp.exe. (In fact, it is best to write a small program called VC ++, but I have never learned VC ++)

Okay, send a code. If you are interested, you can study it. After 7 zip is packaged, it is only 3.26 MB, But it achieves a huge framework without installing Microsoft. I have tested this test project on both pure virtual machines and local machines, but there is a bug that mono does not support the Chinese path well. If there is a Chinese path, Mono cannot run. Later, I tried to use c: \ Program Files \ mono-2.0 \ bin \ mono.exe for execution, so there is no Chinese path problem. I think the missing file is one by one copied to the winapp folder and executed in batches. Later, I simply moved all the files in the entire installation directory to the winapp directory and failed to execute batch processing. However, C: \ Program Files \ mono-2.0 \ bin \ mono.exe can be successfully executed! What is missing?

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.