3

I need to migrate my website which was earlier in target framework 3.5. Now i need to convert it into 4.5, Please tell me that best approach to do it.....

I have tried with visual studio 2012 'Build' option to change it to 4.5. But i am getting lots of script resource error mainly in js file, although these all works fine in 3.5. After changing it to 4.5 , I m getting so many java script errors. So, i am missing something. Need to discuss these errors with you, so currently i am not including any error with you.

Please help me for the the right approach for this.

Any kind of help will be highly appreciated. Thanks in advance.

Anish
  • 588
  • 6
  • 21
Vinay Sinha
  • 193
  • 2
  • 13

2 Answers2

2

You may have problems with some of the HTML elements you have marked as runat="server", specially iFrames.

So, if you a line of code (in you code-in-front) that looks like

<iframe id="myServerSideIframe" runat="server" src=""></iframe>

you are going to have problems loading them. The reason is that the type of the corresponding variable in your code-behind for most of the HTML elements is "System.Web.UI.HtmlControls.HtmlGenericControl". However, in .Net 4.5, there are specific types for each HTML element, e.g. System.Web.UI.HtmlControls.HtmlIframe.

In order to resolve this, one easy way is changing the Id of that element in code-in-front, and changing it back to the original Id. That way, the designer will automatically update the variable declarations in the designer file.

1

Had converted web app from 3.5 to 4.0 (and then to 4.5)

When you open your app in VS2012, it will offer to migrate it to .NET 4.5. Let it do the migration; most of the changes are in the web.config.

Refer to http://www.asp.net/whitepapers/aspnet4 and http://www.asp.net/vnext/overview/aspnet/whats-new for an overview of potential "breaking changes"

You may have javascript problems with ClientID; ClientIDMode=AutoID or static may help.

If you are using 3rd party .NET assemblies, some of them may not work properly. You will have to check with the assembly author for new updates.

Good luck on the migration.

MikeLim
  • 1,189
  • 1
  • 9
  • 11