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/