Framework upgrade from .net 3.5 to .net 4.8 - asp.net

I'm working with one of my clients wherein they are having a few application still written on .net framework 3.5. Though we still have support for .net 3.5, client wishes to upgrade the framework to 4.8. There are no plans to migrate to core/.net 6 as of now but to upgrade to framework's latest version 4.8.
I'm looking for some pointers to migrate an application from 3.5 to 4.8, what could be the runtime changes/retargeting changes/breaking changes. It would be of great help if someone could give me a roadmap to address the problem - where to start from, what details to look into etc. I searched a lot and could not get any specific pointer for my use case. Please help.
Thanks in advance!

Well, in most cases, you should be able to simple set the project up to say .net 4.8 (or 4x). But, you might as well go all the way.
You WILL however has to download and install .net 4.8 on the web server. So, on your developer computer, you most likly do have .net 4.8. But, don't forget to download + install .net 4.8 on the web server (or if it is a hosted plan, find out what is the level of .net they support).
So, for the most part, you should be able to simple in your project, set it as 4.8, and see if it compiles. You have a VERY good chance it will.
That would be this setting project->"my project name properties"
So, the above for the most part should make things work.
Also, once you done the above, (then re-build all). You want to check web.config, and this setting:
<httpRuntime targetFramework="4.8" maxRequestLength="2000000"/>
As noted, you also have to check/ensure that the web hosted server (if this is not a on-site server) also needs the .net frameworks to be downloaded and installed. Often they already are but you want to check that.
It also possible that you are using a asp.net web site as opposed to a asp.net web site application, and thus the above steps do change somewhat.

Related

.Net 1.1 upgrade to .Net 2 - Does it still use the .Net 1.1 framework

We have recently taken on support of a web application that was written many years ago and targeted v1.1 of the .net framework. It runs on Windows Server 2003/IIS 6 environment.
After looking at the configuration of the site in IIS the target framework is set to 2.0.
Given that extended support for .net 1.1 will cease in October of this year (http://support.microsoft.com/lifecycle/?p1=1249) I am trying to ascertain whether the site will still use any of the .net 1.1 framework assemblies given that the application is built and compiled in Visual Studio 2003.
I am assuming this is the case because although ASP.net 2 is set as the target framework
in IIS (and therefore the aspet_isapi.dll invoked is the .net 2 one etc) the assembly is a .net 1.1 assembly and will therefore still use the 1.1 framework. However, is this assumption actually true?
The website only has another year or so to live before being replaced by a new solution entirely so I would prefer not to upgrade it if possible and run the risks such changes bring with them.
However, we obviously can't run something on an unsupported version of the framework if any element of if that framework is actually being used.
Any thoughts would be appreciated.
Update:
It would seem that .net 1.1 is a core component of WS2k3 so you can't just uninstall it. I could have attempted to remove the ASP.net component but I don't think that would fully uninstall everything and given that the dev environment is shared I can't risk causing any issues right now.
However I have previously set everything up on my local machine (Windows 7/IIS 7), so I changed the application pool to point at .net 2 (it was already running in classic pipeline mode), uninstalled .net frameworks 1 and 1.1 and cleaned up the files left behind afterwards.
The result was that the site ran absolutely fine, which would suggest in an IIS 7 environment at least that I don't need to worry about upgrading given we are running under .net 2 within IIS.
It's not an ideal test as it isn't a mimick of our live environment. I'm going to post a question on MSDN and asp.net to see if any Microsoft folks can add anything more definitive. I will post back here with any updates.
Just because official support will end doesn't mean Microsoft will pull the plug and force an uninstall of .NET 1.1 via Windows Update. It only means that:
if a gaping hole in the framework's security is ever found, they'll not fix it;
There won't be redistributables for the next versions of Windows, and the next version of IIS won't run it.
So the application will still run in a year. If you leave the server alone, the application might run until the machine breaks of old age.
So my suggestion is relax, and focus more on the new solution.
I got the answer to this questions after reading this link (provided as an answer to this question on the ASP.net forums)
http://msdn.microsoft.com/en-us/library/ms994381.aspx
Under "Application Load Mechanisms and Possible Issues" it states:
By default, an application built using the .NET Framework will run using the version of the Framework it was built against if that version is installed on the computer
It then goes on to detail (for .net 1.1 and 2.0 at least) when a particular version of the framework is used.
Essentially, because our server has both 1.1 and 2.0 installed the application will still be using version 1.1. If 1.1 was not installed then it would run by default under 2.0, which explains why the web application still worked after I uninstalled .net 1.0 and 1.1 from my local machine.
Given that the live server is W2K3 and I can't remove .net 1.1, I will be rebuilding my application to target .net 4.0.

Web Site Upgrade from ASP .NET 2.0 to 3.5

We have a web application that runs on IIS using .NET 2.0 developed and built with Visual Studio 2005.
We're going to upgrade to .NET 3.5 and begin using Visual Studio 2008. Here are my questions:
I note the runtime is still 2.0-based.
When I loaded the solution in Visual Studio 2008, I was asked to convert, and I did. I then checked the target framework for the default project, and it was set to 3.5. However, all of the other target frameworks for the other projects are set to 2.0.
Do I need to manually set the target frameworks from 2.0 to 3.5 for each of the projects in the solution?
Are there any "gotcha's" anyone can think of to be concerned with a web-application conversion?
As I understand it, the 1.1 to 2.0 migration was a much more difficult issue due to the massive runtime and web-page design changes. However, 2.0 to 3.5 isn't such a big change.
I was not at my current job for that upgrade, but I understand there was a problem with some textarea tags using a deprecated attribute that failed to function correctly after the upgrade.
Can anyone think of any similar issues I might encounter?
Any other issues or thoughts anyone has after having done such a conversion themselves?
Thanks, I appreciate the input.
---Dan---
Do I need to manually set the target
frameworks from 2.0 to 3.5 for each of
the projects in the solution?
Not necessary, but I would recommend you to do so. Visual Studio actually filters the assemblies you can reference based on the target framework version.
Are there any "gotcha's" anyone can
think of to be concerned with a
web-application conversion?
Not any that I am aware of when migrating from 2.0 to 3.5. You don't even need to modify the CLR version of the host application pool. When you need to migrate to 4.0 there might be more issues.
If you're also upgrading your own target server, from my own experiences, be patient with the installer.
It does quite a lot including uninstalling the existing .NET 2.0 and 3.0 frameworks and replacing it pretty much wholesale.
It can look as if the installer is stuck. On one of our production servers it ran for nearly 20 minutes. I was almost ready to pull the plug then it magically jumped into life.

Upgrading IIS web sever framework 2.0 to 3.5 considerations

i will be responcible for upgrading an IIS web server from the Microsoft .NET framework v2.0 to v3.5.
I am wondering if there is anything special i need to know or any caveats i should be aware of before proceding?
The site gets a fair number of hits per day and I will be taking it down and performing the upgrade at an off-peak time.
Aside from double clicking the installer is there anything i need to know?
Will the server need to be rebooted afterwards, does the installer handle all of the configuration changes? etc..
Thanks.
Upgrading from 2.0 to 3.5 is largely seamless since everything still hits the 2.0 runtime. I can't recall a single configuration change I made (aside from running the installer) to our production servers when we upgraded.
If you have a test environment I would really suggest running your upgrade there before your production to make sure you're not going to break anything. If that's not an option, I would recommend reviewing the Microsoft .NET Framework 3.5 Readme which contains some known installation issues and workarounds.

Upgrading ASP.NET from version 1.1 to 2.0 - Any Gotchas?

I know we are really behind the times here, but we are just about to upgrade from .NET 1.1 to .NET 2.0.
Thank you for your sympathy.
Anyhow, are there any gotchas we should look out for?
Do you have any general advice before we jump in?
Please do not post telling me to go straight to 3.5: 2.0 is all we're allowed!
We're using mostly C#.
Yes. The most important thing for you to know is to use a Web Application Project, not a Web Site. Web Sites use a totally different compilation model and migration is pretty much a disaster. Web Application Projects are much more similar to how things worked in 1.1.
We also had an intermittent problem with redirecting from the login screen, but according to Google, we were basically the only ones who had that problem - we've since resolved it.
Most of the other problems we ran into were small and easy to navigate, and the overall experience was a net improvement.
Here is my recommendation before upgrading:
If you are used to use Visual Studio 2003, you will need to go for VS2005. You will have to convert the old solutions and projects so that it will be compatible with VS2005. Make sure to have a backup of the project you're going to convert so that you can roll back or even use it as source for any modification you may need to the converted projects.
If you're developing web applications using .NET 1.1, make sure that all the virtual directories and applications in the IIS is configured to work with ASP.NET 2.0. You may need also to configure a new Application Pool for your .NET 2.0 applications.
If you're using any third party libraries in your .NET 1.1 projects, you may need to confirm its compatibility with .NET 2.0 projects. Some old libraries used in .NET 1.1 are not compatible with 2.0.
One gotcha is home-grown 1.1 implementations of .NET 2.0 stuff (that was missing in 1.1) like RegistryHandler and so forth. Sometimes your newly-ported 2.0 code will look like it's properly using a 2.0 class when it's really using the home-grown version.
Deployment is another gotcha, if you're upgrading an already-deployed app. You have to switch the .NET version in IIS from 1.1 to 2.0.
I remember we had to change some client scripts, because the way ClientIDs are generated for server controls changed from ASP.NET 1.1 to 2.0.
I don't remember the exact circumstances, but some IDs which previously wer prefixed ctl0_ became ctl00_...

.net 3.5SP1 on a .net 3.0 Server - Is it possible to use the /bin Folder in ASP.net?

One of my Websites is on a Shared Hosting Provider, running either .net 2.0 or .net 3.0, but not 3.5 SP1.
I wonder if it would be possible to still use 3.5 SP1 by simply deploying all the 3.5 assemblies into the /bin Folder, since technically it's all still the 2.0 CLR.
I know that if my Host ever updates I have to remove them or else weird stuff can happen, and that I am driving into Unsupported-Territory at full speed, but is there any really big road sign that says "DON'T DO IT!" or even "That is not possible because of X"?
Primary reason is because I want to use ASP.net MVC and possibly ADO.net Entity Framework, but I do not want to make a contract with yet another Hosting provider.
Thanks!
In theory it can be achieved, but it's definately not recommended.
Scott Hanselman did a post on how to run ASP.NET MVC onto a server with other .NET 2.0 installed, see - http://www.hanselman.com/blog/DeployingASPNETMVCOnASPNET20.aspx
It's very much a "works on my machine" certified post though.
All DLL's on an ASP.NET site can reside within the /bin, provided they are correctly referenced. My suggestion - create a virtual machine (MS Virtual PC is free), install just .NET 2.0/ .NET 3.0 and then copy the DLL's you require from a .NET 3.5 install (tip - you'll find the DLL's in %program files%\Reference Assemblies).
I take no responsibility for the damage you cause to your provider from this answer
I'm pretty sure you can't do this, but googling on the following blogs may get you the definitive answer:
ScottGu
ScottHa
BradA
The problems would be, I think:
You want to load system.dll. Where does it look? does the GAC take precidence? (I think it does), therefore you get 2.0. So you have system.dll v2.0, and you try to use a DLL (eg system.web.mvc) which is bound to system.dll v3.5, but is only in you /bin.... it should explode loudly, not having the same contracts and the like.
Personally, I wouldn't try it, especially on production. But if you can take the site down for a while, give it a go. Worst case, you have to delete the files and re-upload the old site.
YMMV :)
I've successfully run some EntityFramework websites on hosts that only had .net 3.5 installed. I copied the System.Data.Entity.dll and the System.Web.Entity from Program Files%/Reference Assemblies. I also had to modify my web.config and remove the references to the System.Data.Entity and System.Web.Entity.
Update: this technique will not work for DynamicData or the EntityDataSource web control. I belive it has to do with the System.Web.WebExtensions.dll which already exists in the GAC from 3.5

Resources