.NET 4.0 and 4.5.1 on one server, giving issues? - asp.net

Can .NET 4.0 and .NET 4.5.1 runtime be installed on one application server so that web apps targeting .NET 4.0 and web apps targeting .NET 4.5.1 will be running smoothly ?
(I heard from collegaes that 4.5.1 will break 4.0 apps after 4.5.1 is installed...)

No there is no such way as of now.(that mean what you have heard from your colleagues is quite right!) I think it is a known issue and yes 4.5.1 overwrites 4.5 so make sure you have the same version installed on your development machine and on the server. You may definitely get some more info of your problem in this MSDN blog and this MSDN
Because if you develop "Targeting .NET 4.0", then you clearly plan to
run on a machine that DOES NOT HAVE .NET 4.5!
You need to target the .Net4.0 framework to get rid of your problem

Related

Asp.Net Core 2.1 with .Net Framework 4.6.1 error after deployment using dotnet publish or visual studio publish

I am trying to deploy Asp.Net Core 2.1 application with target framework 4.6.1 on server. I am using dotnet publish command and copying the publish folder on the server where deployment is intended. Everything works fine on local machine. But when I am trying to run the application on the server , it is throwing the exception ".Net Framework 4.6.1 not installed, please install it.".
I thought .Net framework is not installed but when I checked installed software , I can see .Net 4.6.1 is installed. Not sure why the error is occurring.
Here is screenshot for the application error and installed software
That error is odd, since you do indeed seem to have that version installed. However, I believe it may be a red herring. I haven't personally tried to run ASP.NET Core 2.1 on .NET Framework, but I suspect it may not work at the moment. The full framework support depends on .NET Standard compatibility which only goes up to .NET Core 2.0. (With .NET Standard 2.0). ASP.NET Core requires .NET Core 2.1. You can try targeting a later version of .NET Framework - something recent like 4.7.2. You may need to downgrade to ASP.NET Core 2.0, if you need to target .NET Framework.
Your list only shows development packages to support targeting and developing for .NET Framework 4.6.1
See How to: Determine which .NET Framework versions are installed for ways to check the .NET Framework version on the machine.

IIS7 Application Pool 4.5 framework

I built a web app using dotNet 4.5. I went into IIS and created a new app pool but there was not 4.5 option, only 4.0 and 2.0. I went to install 4.5 and it says "already installed". I do a google search and see infact the registry and explorer show it to be installed.
What gives?
Although the .NET Framework Version column shows "v2.0" and "v4.0" for .NET Framework versions, these equate to ASP.NET 3.5 and ASP.NET 4.5.
Due to the internals of how application pools bind to .NET Framework versions, the actual version name written to configuration (and thus displayed in the tool) corresponds to the original .NET Framework file version.
Your question is tagged as IIS7 but the link information regarding .net versions is applicable.
Soruce: http://www.iis.net/learn/get-started/whats-new-in-iis-8/iis-80-using-aspnet-35-and-aspnet-45

Running ASP.NET vNExt on .net 4.0

If I have a server running on .NET Framework 4.0.
Will it be possible to run ASP.NET vNext on top of that? Or will a higher framework version be required?
As stated on Asp.NET vNext's page on GitHub the minimum requirements for Windows as follows:
Windows 7 or Windows Server 2008 R2.
.NET 4.5.1 for hosting in IIS
However, ASP.NET vNext will let you deploy different versions of the .NET Framework via NuGet packages for different apps on server as stated here. But it's not .NET Framework 4.0 anyway. So, you need the higher version.

Running IIS .NET4 Application under a .NET2 Site

Is it possible to host a .NET 4 application under a .NET 2 site?
For several reasons we have to run the main site on .NET 3.5, but there is an application written in entity framework 4, which hosted under the same domain/port.
When I try to add an application under the site (using a different .net 4.0 application pool), i get an error stating duplicate content in web.config. I have searched the net for fixes, but none of them seems to be working for me.
I am running a Windows Server 2008 R2 with IIS7.5
Any help would be appreciated.
It is possible to fix, if you carefully read Microsoft's document,
http://msdn.microsoft.com/en-us/library/a99txfy5.aspx
and
http://www.asp.net/whitepapers/aspnet4/breaking-changes#0.1__Toc256770150
No, that's not possible. An assembly compiled against .NET 4.0 must be run inside CLR 4.0. It is possible the other way around: run an assembly compiled against .NET 2.0 inside CLR 4.0.
No, the nested application will not be able to set a seperate framework version. I would suggest changing the version on the main site to v4. I don't think you should experience problems running a 3.5 app on version 4. What are your reasons for running it in 3.5?

Installing .NET 3.5 on a server with .NET 2.0 applications

I would like to upgrade my web projects on an IIS 5 server from .NET 2.0 to .NET 3.5. These web applications live on a server with other web applications that will not be upgraded to .NET 3.5. The server administrator is reluctant to install .NET 3.5 because he is afraid it will break the applications on that machine that are running 2.0 and 1.1.
As far as I know this WON'T be a problem since .NET 3.5 is an addition to 2.0 more than it is a new Framework. I would like the communities help gathering evidence to show him that their concerns are moot and it won't hurt the other applications.
Thanks in advance.
If you have .NET 2 SP1 you shouldn't have a problem.
To be exact .NET 3 & 3.5 are built on top of .NET 2.0 SP 1, we had a problem deploying 3.5 onto a server which only had .NET 2 (not SP1) and it caused the apps on there to break. The reason is your core framework assemblies in .NET 2 are upgraded and have new version numbers which the app wasn't compiled against.
It won't have any problem and you will be able to run your 2.0 and 3.5 application using the same server. This is because the code base for both of the frameworks is the same.
Walk the server administrator through the content of the redistributable for 3.5. It adds a lot of new dlls it doesn't update anything in the 2.0.x directory. You might want to show him how the apps targeting 3.5 are still using System.dll etc from the 2.0.x framework directory.
Both frameworks can run concurrently. In fact, that is the default behavior.
One caveat though, make sure that you don't use the same application pool for apps using different versions of the framework. Otherwise you will get "Server Application Unavailable" errors. Use a different app pool for each set of applications.
Installing 3.5 will modify your .NET 2.0 web.config file and a few others.
This certainly breaks at least 1 application I use. Uninstalling 3.5 will revert the files and fixes the issue.
I've upgraded a couple servers from .net 1.1 to 2.0 & 3.5ץ there haven't been any problems.

Resources