Run code 3.5 in Framework2.0

Source: Internet
Author: User
Www.cnblogs.comimfunnyarchive201511111094639.html because many servers, especially cheap servers, use the Framework v2.0.50727. Coupled with self-developed products, it is necessary to reduce the initial costs of some customers, while they also like simple code. Later, I checked and learned that F

Http://www.cnblogs.com/imfunny/archive/2011/08/11/2134639.html because many servers, especially cheap servers, use the Framework v2.0.50727. Coupled with self-developed products, it is necessary to reduce the initial costs of some customers, while they also like simple code. Later, I checked and learned that F

Http://www.cnblogs.com/imfunny/archive/2011/08/11/2134639.html


Because many servers, especially cheap servers, use the Framework v2.0.50727. Coupled with self-developed products, it is necessary to reduce the initial costs of some customers, while they also like simple code. Later I checked and learned that Framework3.5 can also run on 2.0. Reference System. Core. dll can be directly written. It won't work in 2005. Because 2005 defaults to 2.0 compiler. It is useless even if it is referenced.


Click attribute settings. See you. In this way, you can directly use it on Vs2008. (These are all stored in the attachment. You only need to click the download link .)


What are the advantages of using this.
First, the method is extended.
For example, MD5.

?

string dd = Utils.Md5("ddddd");

Now you can use method extension to write

?

var dd = "ddddd".Encode(Encode.Md5)

The current Code is getting more and more Query styles. I like it. In fact, I will not talk about anonymous functions, lamda expressions, and linq.

After this step is completed, the compiled Dll can be run directly under 2.0.


However, during WEB development. It can be run in 2.0 after compilation. It is impossible to compile all the Dll files for each modification. CodeFile also has an error in this case. Because CodeFile still has errors at this time. The value of csc.exe is 2.0. This is simple.

Decompress the attachment package and click "obtain permission" in the attachment. reg ", find the directory C: \ Windows \ Microsoft. NET \ Framework \ v2.0.50727, right-click the menu and click "get permission change. Then extract v3.5.rar from the attachment and replace the file in v3.5 with v2.0.50727. Then the compiler is changed. Click "get permission to uninstall. reg ". Delete the "get permission" button in the menu.

There is a picture with the truth:


XP should be the same. The test is not specific.


OK. The big work is done. Now everything is on the cloud. The rest is just getting better. The DLL generated during release can be directly put on the production server. Everything is that simple. The rest is to write 3.5 programs in the 2.0 style.

The tools used above have been sorted out by nakassa. In the attachment, click the attachment to download it.

Attachment download

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.