Installing asp.net web app on new server - c#

I have an asp.net web application I have built using Visual Studio 2010 C# (.net 4.0). I deployed it successfully onto Windows Server 2003 with .net framework 4.0 installed on it.
I am now trying to deploy it on Windows Server 2012 R2 with .net framework 4.5 installed on it (I have to use 4.5 as another application on the machine requires it).
I am getting this error message during instillation:
Could not open key: Software\Microsoft\ASP.NET\4.0.30319.0. Verify that you have sufficient access to that key, or contact your support personnel.
I have read many posts that suggest I rebuild my application changing the 'ASPNETVersion' to 2.0 instead of 4.0. This does not work however as .net framework 2.0 is not installed on the server and I encounter build issues when building on my dev machine with .net 4.0.
IIS Application pool is pointing NET CLR to 4.0. The version of .net in the server regedit file is v4 (Client 4.5, Full 4.5), v4.0 (Client 4.0).
Is this possibly because v4.0 Client profile is installed rather than the full 4.0 .net install? I have looked online and it doesn't look like full 4.0 .net can be installed on Windows Server 2012 R2?

I wrongly presumed that ASP.NET was part of the .NET framework installation. I went back to the IIS install and installed ASP.NET which was listed under the development section. The Installer now starts correctly.

Related

Determine Asp.net version of the web application deployed in IIS server with multiple .net framework versions

Need to find which .net version is used by web application after its deployed in IIS server with multiple .net framework versions installed in it
My Asp.net web application is compiled with target framework 4.0 and deployed in IIS 10 server. In IIS server, application pool is configured to run with CLR version 4.0.30319.
In the Deployment server, .net framework 4.0 to 4.6.2 is installed. Found this from regedit.
In this case, how to find if the web application is running under the 4.0 framework or 4.6.2 framework ?
While printing the environment.version property in aspx page of the web app, the version displayed is 4.0.30319.42000.
(https://learn.microsoft.com/en-us/dotnet/framework/migration-guide/how-to-determine-which-versions-are-installed "Microsoft Version Detection Link")
According to the above Microsoft link, 4.0.30319.42000 means .net framework version is 4.6 or above.
However, as per above link, environment.version property is not supposed to be used to identify the .net framework version post 4.5 series.
Hence confused how to find out the framework version under which web application is running ? Does it run with latest .net framework version ? Any property or official method to find this.
Intention is to migrate the web application to run with latest target framework if it's running currently below 4.5.1 version as these are not officially supported.
Sorry for the long post but couldn't explain in less words.

Can I run .NET core 1.0 app on server with framework 4.0?

The server runs windows server 2008 R2 that has .NET 4.0 framework as its highest supported version. I did see people commented that .NET core supports frameworks comes later than 4.5.
I think you can run it on Windows 2008 R2 if you install SP1 and the suitable Core Framework.
Supported Windows Version:
Windows 7 SP1
Windows 8.1
Windows 10
Windows Server 2008 R2 SP1 (Full Server or Server Core)
Windows Server 2012 SP1 (Full Server or Server Core)
Windows Server 2012 R2 SP1 (Full Server or Server Core)
Windows Server 2016 (Full Server, Server Core or Nano Server)
and your System should be up to date:
For Windows 7 and Windows Server 2008 machines only:
Make sure that your Windows installation is up-to-date and includes hotfix KB2533623 installed through Windows Update.
You can find more information here:
https://learn.microsoft.com/en-us/dotnet/core/windows-prerequisites
or you can read the release information form the differnt core versions on github.
According to .NET Core documentation here, you can target Windows Server 2008 R2 SP1 on .NET Core.
You can also upgrade to .NET Framework 4.5.2 on Windows Server 2008, refer this link.
If however, you cannot upgrade to .NET Framework 4.5 and above, I think you are out of luck. Refer .NET Standard
.NET Core doesn't know about, or really interact with, .NET Framework. Conversely, .NET Framework doesn't really know about, or interact with, .NET Core. So this question is sort of like "can I put Photoshop on a machine which currently has mspaint, but not paint.net?".
.NET Core applications can either be published and run in a mode where they depend on a shared framework having been installed, which makes each individual application smaller but has a prerequisite. Or, you can publish an application as everything it needs to run on some other machine as a "self-contained" or "standalone" application, which makes the application easier to run on an arbitrary machine (of the correct OS family) but at the expense of it being larger.
If you can't change the dependencies of the target machine at all, you want to go the self-contained route. If .NET Framework 4.0 is the newest available (even though it is out of support) because of an admin being concerned about upgrading shared dependencies then maybe you can get the .NET Core runtime installed, since it won't interact with .NET Framework, and then you can stick with the smaller footprint deployment.
For an explanation of self-contained vs framework-dependent (and how to do it), see
https://www.hanselman.com/blog/SelfcontainedNETCoreApplications.aspx

Windows Services / .net environment

We are planning to upgrade to windows server 2008 machine (from server 2003) and have a bunch of windows services written in visual studio 2003/2005 that we will have to migrate. My concerns is that on server 2008 there is no .NET 1.1 framework, as we had on the server 2003.
I have some doubts, but hopeful to clear them here:
Are windows services 'targeted' for specific .net environments?
If, yes, how can I migrate to framework to 2.0?
Can I use the installutil from .net 2.2 to install a .net 1.1 win service?
Are windows services 'targeted' for specific .net environments?
Not specifically. .NET assemblies are version specific, but usually backwards compatible. A .NET 1.1 assembly will still run on a 2.0 or higher .NET version. I do suggest to upgrade though since .NET 1.1 is more than ten years old already.
If, yes, how can I migrate to framework to 2.0?
You have to change the targeted .NET Framework for the Visual Studio project. You can do this in the Project Settings dialog. You have to recompile and distribute that newer version.
Can I use the installutil from .net 2.2 to install a .net 1.1 win service?
Yes. The installutil is not something .NET specific. It will work for any exe as far as I know.
You can install .NET 1.1 (and also a SP1) on Windows 2008. It warns you about conflicts but works ok.

Windows Server 2008 Application Pool set to .Net 4

I am trying to deploy an MVC application to a server with the correct versions of .NET installed, the application pool has been set to .NET 4 but the error says .NET 2
Have a look at the screen shots below, maybe you can point me in the right direction
and
The server probably does not have the 4.5 framework installed. Both 4.0 and 4.5 MVC applications will run under the 4.0 app bool but if your application is complied against 4.5 you will need that installed on the target server.

Compatibility problems in deploying c# win form application

I am facing a lot of trouble while deploying a windows form application on a CD. I have made the application in .NET framework 2.0 and I want to include the setup for the framwork with the installation disk. The application is to run on WindowsXP(damn, user requirement). I tried deploying it with 1 click deployment in VS2010 but the setup does not run on winXP.(Error-.NET framework 4.0 required to run the application). Is there any way of deploying the app which can run on winXP(.NET 2.0), win7(.NET 4.0)-32 bit as well as 64 bit environment.
A 32 bit app will run on 32 or 64 bit operating systems.
A .NET 2.0 application will run on .NET 2.0 or .NET 4.0.
Sounds like your installer is the only dependency on .NET 4. Check the publishing prerequisites you have set on your project.
Visual Studio 2010 doesn't provide a .Net 2.0 pre-requisite for deployment projects. A MSDN support rep explained (?) this in this question:
In VS 2010, it doesn’t support you to set .NET Framework 2.0 as
prerequisite. You can set .NET 3.5 SP1 client profile instead.
Although your application is still build target to .NET 2.0, .NET 3.5
client profile is a light weight .NET framework run time which
supports to run .NET 2.0 based application. So Microsoft removes .NET
2.0 from the prerequisite list.
There's a solution though in that thread:
If you take the .NET 2.0 package from the VS2008 bootstrapper packages
folder and copy it to the corresponding location for VS2010, it works
fine. I tested it in a virtual machine running Windows XP and no .NET.
On Vista or Windows 7, the VS2008 packages are here:
c:\Program Files\Microsoft
SDKs\Windows\v6.0A\Bootstrapper\Packages\DotNetFX (this is .NET 2.0)
On Vista or Windows 7, the VS2010 packages are here:
c:\Program Files\Microsoft SDKs\Windows\v7.0A\BootStrapper\Packages
See the other posts in the thread for more detail.

Categories