asp.net 4.0 upgrade to ASP.net 4.5 where attention is required

Source: Internet
Author: User

I thought that as long as you set the target framework of each project to. NET Framewor 4.5 to compile in Visual Studio 2012, Then set the compilation targetframework to 4.5 in the Web.config and upgrade to ASP.net 4.5.

<compilation targetframework= "4.5"/>

Later found that this is not enough, but also need to set up in the Web.config httpruntime targetframework.

 

That's the real upgrade to ASP.net 4.5.

After the upgrade there are two places that require special attention:

1. Setting of machinekey in Web.config

The default setting for ASP.net 4.5 is:

<machinekey compatibilitymode= "Framework45"/>

ASP.net 4.5 improves the Add/Decrypt algorithm for form validation, and if you do not upgrade all asp.net applications to asp.net 4.5 at the same time, you need to modify the CompatibilityMode settings to maintain the compatibility of the forms validation.

<machinekey compatibilitymode= "Framework20sp1"/>
<machinekey compatibilitymode= "Framework20sp2"/>

2. Impact on WebForms form validation controls

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

WebForms Unobtrusivevalidationmode requires a scriptresourcemapping for ' jquery '. Please add a scriptresourcemapping named jquery (case-sensitive).

Workaround: Add the following settings to the <appSettings> of web.config

<add key= "Validationsettings:unobtrusivevalidationmode" value= "None"/>

What you need to pay attention to when you upgrade to ASP.net 4.5, look forward to your sharing!

More Wonderful content: http://www.bianceng.cnhttp://www.bianceng.cn/webkf/aspx/

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.