Notes for upgrading ASP. NET 4.0 to ASP. NET 4.5

Source: Internet
Author: User

Originally, you only need to set the target framework of each project in Visual Studio 2012. net framewor 4.5, and then in the web. when the targetframework of compilation is set to 4.5 in config, It is upgraded to ASP. net 4.5.

 
<CompilationTargetframework= "4.5"/>

Later it was found that this was not enough. You also need to set the targetframework of httpruntime in Web. config.

 
<HttpruntimeTargetframework= "4.5"/>

In this way, it is truly upgraded to ASP. NET 4.5.

Note the following two points after the upgrade:

1. Machine Key settings in Web. config

The default settings for ASP. NET 4.5 are as follows:

<MachinekeyCompatibilitymode= "Framework45" />

ASP. NET 4.5 encryption/decryption of Form VerificationAlgorithmIf not all ASP. NET applications are added at the same timeProgramUpgrade to ASP. NET 4.5. to maintain the compatibility of Form Verification, You need to modify the compatibilitymode settings.

 
<MachinekeyCompatibilitymode= "Framework20sp1"/>
 
<MachinekeyCompatibilitymode= "Framework20sp2"/>

2. Impact on webforms form verification controls

If you use a verification control such as <asp: requiredfieldvalidator/>, the following error occurs:

Webforms unobtrusivevalidationmode requires a scriptresourcemapping for 'jquery '. Please add a scriptresourcemapping named jquery (case-sensitive ).

Solution: Add the following settings in <etettings> of Web. config:

 
<AddKey= "Validationsettings: unobtrusivevalidationmode"Value= "NONE" />

You will find out what you need to pay attention to when upgrading to ASP. NET 4.5. We look forward to sharing with you!

 

References:

All about

cryptographic improvements in ASP. NET 4.5

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.