How can we migrate existing web applications from .net 2.0 to 4.0 in installshield project - installation

We have a number of Installshield projects that install and configure IIS applications. We have shipped several versions of the different applications (over 7 versions of 3 applications) and would now like to upgrade to use .net 4.0 instead of 2.0 & 3.5.
After modifying the "Internet Information Services" settings to change the ASP.NET Version on the web sites/application to 4.0.30319 and the .Net Framework version to v4.0 under the application pool, the installer correctly creates an application with the 4.0 version in IIS 6 and below, and in IIS 7 and above it correctly sets the pool to use v4.0, but upgrades do not work for any targets.
The upgrades install OK, but the .Net version of the virtual directory or application pool remain unchanged. Changing it manually works of course, but this would lead to increased support issues.
I have tried changing the upgrade to be a major upgrade, with no success, I am currently working on a custom action to change the .Net version after installation, but I don't have much experience with this feature of Installshield.
Has anyone experienced this issue? Are there any preferred ways of achieving this? (custom actions, or a .Net installer class, WIX is not an option)
Thanks

Without spending hours to dig into it... one quick solution would be to rename the app pools in your new installer and let a major upgrade create the new and remove the old. After all, if you are changing from .NET 2.0 to 4.0, in a sense you are creating a component that is not backwards compatible and thus should be a new component.

Related

VS 2019 Project Target Framework Not Installed - .Net Framework 4.0

Just installed VS 2019 Pro on a new system. When I open a solution with .net 4.0 project, I get this error: Project Target Framework Not Installed.
When I choose download it, it goes here but does not have option for .net framework 4.0.
In project settings there is no option for .Net Framework 4.0 in targeting framework:
https://dotnet.microsoft.com/en-us/download/visual-studio-sdks?cid=getdotnetsdk
I have tried installing 4.6.2, 4.5.2, etc.
How can I get this project to open? It opens on my other machine. It has these options for Target framework in project settings:
Please don't say change the framework version, we need this older version for very old computers running XP and Win 7 that cannot be upgraded.
thank you
You have to go directly to their download site. As shown in another correct answer that was downvoted, it's still available even though it's past end-of-life.
https://stackoverflow.com/a/72870727/9008140
You can package the install files with your app just in case, although most likely your installer will see that it's missing and download it anyway.
You can try downloading .Net 4.0 here: https://dotnet.microsoft.com/en-us/download/dotnet-framework/net40
Mandatory warning: Installing an old, unmaintained .Net framework comes with security risks. It's up to you to determine how much those Windows XP PCs are vulnerable and manage said risks.

Running ASP.NET 4.5 site on host that does not support it?

I use crystaltech for my sites. Yet they have not installed asp.net 4.5 and as far as i can tell have no plans to do so in the near future. Is it possible to run a ASP.NET 4.5 site on a host that does not yet have it installed by uploading ALL the needed DLLs? Apologies in advance if not seen as constructive and closed.
It is not possible to do this. Much of the new 4.5 functionality is provided by the .NET Framework itself, and these binaries (mscorlib.dll, System.dll, System.Web.dll, and others) need to be installed on the machine. They cannot be dropped in the bin/ folder.

What are the risks of running VS2010 side by side with VS2012?

Officially, it's supported. I get that. I've personally done it in a VM. My question is, are there any hidden gotchas of running VS2012.x side by side with VS2010 SP'd and hotfix'd? I recall reading about an issue with the version of .NET or the CLR, I don't recall the details and it was last fall.
My coworkers and I would really like to move to 2012 but we have a lead developer that refuses to move. We need to convince him, especially since we have a large project that was started on 3.5, moved to 4.0 (will not go to 4.5), but we've heard rumblings about the aforementioned possible problem.
.NET Framework 4.5 is an in-place update. This means that once you install it all apps (including VS 2010) will be running against .NET Framework 4.5 and not .NET Framework 4. While there has been a great effort to make .NET Framework 4.5 backwards compatible there are some (mostly minor) bugs where the behavior changed in .NET Framework 4.
I think the biggest thing you should consider is whether you are going to target .NET Framework 4 in your apps. The problem is that when you target .NET Framework 4 your VS2012 will only allow you to use APIs that as they were in .NET Framework 4 but your app will actually run using .NET Framework 4.5 runtime. I have seen cases where a legitimate bug in .NET Framework 4.5 was fixed (i.e. an incorrect exception is no longer thrown) but when you run your app against real .NET Framework 4 the app did not work even though it targeted .NET Framework 4 because the bug is still there. Note that you can get to the same situation even with VS 2010 if you install .NET Framework 4.5 on your box. I have been running both SxS and I have not had any problems (but am primarily using VS2012 - is so much faster and more stable).
I think the main take aways here are
if you are working on .NET Framework 4 make sure you test your app on real .NET Framework 4
try running VS2012 sxs with VS2010 on a limited set of machines and if you don't see any problem move on
you may also try running VS2012 only if you don't use any functionality that is not supported in VS2012 (the biggest risk in this case is the .NET Framework anyway and running VS2010 only will not protect you anyways)

Web Developer 2010 Express does not list 4.0 framework

Whatever I do for several days now, Web Developer 2010 Express does not see 4.0 NET Framework. If to right click on solution properties in the Application – Target Framework it lists 2.0, 3.0 and 3.5, which are NOT installed on my computer but 4.0 which is actually installed. I tried to clean all using dotnetfx_cleanup_tool, reinstalled 4.0 client and full several times, copied reference assemblies to different folders and so on but WDE still does not see it.
I also have SDK for Windows 7 and .NET Framework 4 installed.
Where and how does it find frameworks, does in scan registry or some config file?
To target .NET 2.0/3.0/3.5, you have to install .NET 3.5.
And Web Develoepr requires full profile, not client profile.

Why is the Target Framework dropdown empty and greyed out in my C# class library, VS2008

Fairly self-explanatory. I have recently installed .NET framework 4 and VS2010 but I want to compile my 3.5 projects using 3.5 as 4 has not yet been installed on our production servers and I get "This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded." if I try
All project types have the target framework dropdown greyed out
Make sure that your registry keys:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\OnlyUseLatestCLR
and
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\OnlyUseLatestCLR
are set to 0 (not 1).
This fixed it for me since applications like VS2008 are no longer forced to use .NET 4.0 runtime. I had previously set these registry keys to allow Powershell run inder .NET 4.0, however, a config file should be used for that instead.
This has something to do with .NET 2.0 assemblies (i.e. mscorlib) being removed from GAC.
I managed to fix this by first uninstalling .NET framework 3.5 and 4.0 from my Windows 7 using .NET framework cleanup tool:
http://blogs.msdn.com/b/astebner/archive/2008/08/28/8904493.aspx
And then reinstalling both frameworks (first 3.5, then 4.0) from the web. Now the drop-down has options again in VS2008 and I can multi-target 3.5 framework from VS2010.

Resources