How to register .Net 4.5.1 with IIS8 on windows 10 - asp.net

How to register .Net 4.5.1 with IIS8 on windows 10 machine?
it used to be simple as running command "aspnet_regiis -i"...but not anymore. if try to run this command i get error
This option is not supported on this version of the operating system.
Administrators should instead install/uninstall ASP.NET 4.5 with IIS8
using the "Turn Windows Features On/Off" dialog, the Server Manager
management tool, or the dism.exe command line tool. For more details
please see http://go.microsoft.com/fwlink/?LinkID=216771. Finished
installing ASP.NET (4.0.30319.0).
Also in windows 10 under "Turn windows feature on & off" windows why i dont see .net 4.5 or 4.5.1? i do see 4.6 though. Is it same as 4.5.1?
(note i am sure 4.5.1 is installed on my machine because visual studio allows me to set target framework 4.5.1 on web applications and i have several applications which runs on 4.5.1 without any issue)

You can use the dism tool to enable features built into Windows. To install .NET 4.5 (or 4.6, they're the same since it's the same CLR4 underneath) into IIS, I think this will work:
dism /online /enable-feature /featurename:IIS-ASPNET45 /all
The /all flag will include any dependencies so you don't have to figure them all out.
You can also see all of the available features by running:
dism /online /get-features
As an aside, aspnet_regiis was used when you needed to install a version of the CLR into IIS. Since all versions of .NET since 4.0 use the same CLR versions, this is now built into the Windows features. So you use DISM to enable the feature instead.

i do see 4.6 though. Is it same as 4.5.1?
.NET 4.6 is a drop in replacement over 4.5.1. Meaning, your 4.5.1 applications will run on 4.6. So you could say that 4.6 "includes" 4.5.1.

If you're ASP.NET version agnostic and just want the ASP.NET State Service running, Go to IIS -> Web Server (IIS) -> Web Server -> Application Development and choose the latest ASP.NET. This will create ASP.NET State Service in Services.msc which you can then configure to run.

Related

Register asp.net in IIS 10

I have one issue which is related with registering asp.net in IIS 10.
My environment is Windows 10, IIS 10, VS 2013 and VS 2015 installed, .NET 3.5 is a feature in Windows Features.
I want to use nettcpbinding in iis, so, I installed WCF HTTP activation and WCF Non-HTTP Activation. After it, I will need to re-register asp.net in IIS. I run below command
C:\Windows\Microsoft.NET\Framework64\v4.0.30319>aspnet_regiis -i
And I got below result, is asp.net registered correctly in IIS?
Any help would be appreciated.
Microsoft (R) ASP.NET RegIIS version 4.0.30319.0 Administration
utility to install and uninstall ASP.NET on the local machine.
Copyright (C) Microsoft Corporation. All rights reserved. Start
installing ASP.NET (4.0.30319.0). This option is not supported on this
version of the operating system. Administrators should instead
install/uninstall ASP.NET 4.5 with IIS8 using the "Turn Windows
Features On/Off" dialog, the Server Manager management tool, or the
dism.exe command line tool. For more details please see
http://go.microsoft.com/fwlink/?LinkID=216771. Finished installing
ASP.NET (4.0.30319.0).
For this issue, I resolved by below command to install asp.net in IIS.
C:\Windows\Microsoft.NET\Framework64\v4.0.30319>dism /online /enable-feature /featurename:IIS-ASPNET45

In Microsoft Azure .net Framework is not recognized in IIS Application Pool

I am trying to make some ASP.NET website work on Azure.
I have a SQL Server running on the same machine, meaning minimum .net 3.5 is working on it. Also I installed version 4.0 and 4.5 while 4.0 shows up in registry and 4.5 won't show up. Also I can't re-install 4.5 because it is already installed.
In IIS only the .net CLR version shows up, there is no option to make my websites use any other .net Framework version.
When I try to register them using command line : aspnet_regiis.exe -ir
I get the following error on my 2012 Windows Server:
This option is not supported on this version of the operating system. Administr
ators should instead install/uninstall ASP.NET 4.5 with IIS8 using the "Turn Win
dows Features On/Off" dialog, the Server Manager management tool, or the dism.e
xe command line tool. For more details please see http://go.microsoft.com/fwlin
k/?LinkID=216771.
also it shows:
Finished installting ASP.NET ...
But nothing shows up in IIS. What options do I have left? I don't know any.
Here my selected version in IIS, 4.0
Here what It shows for the apppools
http://www.iis.net/learn/get-started/whats-new-in-iis-8/iis-80-using-aspnet-35-and-aspnet-45
This has all details. Basically in server you need to use "Add Roles". So check whether 4.5 is enabled in the "Web server (IIS)" role.

Can't register .net 4.0 in IIS on windows 8

I tried running aspnet_regiis.exe -ir in an admin cmd but no luck.
Any ideas?
C:\Windows\Microsoft.NET\Framework64\v4.0.30319>aspnet_regiis.exe -ir
Microsoft (R) ASP.NET RegIIS version 4.0.30319.17929 Administration
utility to install and uninstall ASP.NET on the local machine.
Copyright (C) Microsoft Corporation. All rights reserved. Start
installing ASP.NET (4.0.30319.17929) without changing existing web
applica tions to use this version of ASP.Net. This option is not
supported on this version of the operating system. Administr ators
should instead install/uninstall ASP.NET 4.5 with IIS8 using the "Turn
Win dows Features On/Off" dialog, the Server Manager management tool,
or the dism.e xe command line tool. For more details please see
http://go.microsoft.com/fwlin k/?LinkID=216771. Finished installing
ASP.NET (4.0.30319.17929) without changing existing web appl ications
to use this version of ASP.Net.
whats all this scary talk about install/uninstall ASP.NET 4.5..
The solution for me on Windows Server 2012 was to:
In IIS, Open Modules, Remove the ServiceModel module.
In IIS, Open Handlers, Remove the svc-Integrated handler.
Restart IIS
More here: http://www.codeproject.com/Articles/613812/Solve-IIS-8-Error-Could-not-load-type-System-Servi
The situation that caused this was the fact that I enabled WCF services after I had already set up IIS and .NET 4.5. This caused all of my apps on the server to fail.
After I completed the above steps to get everything except WCF back up and running, I still needed WCF to work. To accomplish that, I then went into "Turn Windows Features On and Off" and enabled .NET Framework 4.5 Features -> WCF Services -> HTTP Activation
aspnet_regiis is deprecated in IIS8. When we install IIS (ASP .NET 4.5 and other components) automatically asp .net gets registered. We don't need to manually register it.
Can you briefly specify the problem you are facing?
Run the following command from an administrative command prompt: dism /online /enable-feature /featurename:IIS-ASPNET45
For Windows 8 client computers, turn on "IIS-ASPNET45" in "Turn Windows Features On/Off" under "Internet Information Services-> World Wide Web Services -> Application Development Features -> ASP.NET 4.5".
reference: http://support.microsoft.com/kb/2736284
I was facing the same issue as described above. It didn't work even after running following command
dism /online /enable-feature /featurename:IIS-ASPNET45
The solution for me was to install patch to VS 2010 SP1.
Just to give the background I have Windows 10 and VS 2010 SP1 and was facing issue when running a ASP.Net 4.6 site.
Following are links for Visual Studio versions:-
VS 2010 SP1 =>
https://support.microsoft.com/en-us/help/3002340/unexpected-dialog-box-appears-when-you-open-projects-in-visual-studio
VS 2012 =>
https://support.microsoft.com/en-us/help/3002339/unexpected-dialog-box-appears-when-you-open-projects-in-visual-studio
VS

Deploying .NET 4.5 web app with Web Deploy

I have a working ASP.NET MVC 3 application. The project is built with VS 2010 and targets .NET 4.0. Now I re-targeted it to .NET 4.5 and successfully recompiled. Trying to deploy it to our test server (Windows 2008 R2 SP1) now fails:
Error Code: ERROR_APPPOOL_VERSION_MISMATCH
More Information: The application pool that you are trying to use
has the 'managedRuntimeVersion' property set to 'v4.0'.
This application requires 'v4.5'. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_APPPOOL_VERSION_MISMATCH.
The server has .NET 4.5 installed but there is no app pool 4.5 (because it's inplace upgrade and as I understand 4.0 pool should be fine). The client machine has VS 2012 and so Web Deploy 3 (was Web Deploy 2 previously). I also installed Web Deploy 3 to the server.
Tried to re-register ASP.NET with aspnet_regiis - no luck.
Why do I get the error and how can I fix it? This is so frustrating...
p.s.
Found similar question about RC but it does not help
Update:
Looks like this is a bug Microsoft hasn't fixed since CTP. IgnoreDeployManagedRuntimeVersion property did the trick. What a shame!
You can try adding this property to the project:
<IgnoreDeployManagedRuntimeVersion>True</IgnoreDeployManagedRuntimeVersion>
Windows Server 2012 includes .NET 4.5 by default and (when Web server role added) IIS has the following app pools: DefaultAppPool, .NET v4.5, .NET v4.5 Classic that use .NET Framework 4.0 (because 4.5 is inplace upgrade of 4.0). However, if we install .NET 4.5 redistributable on Windows Server 2008 that has .NET 4.0 installed the pools are not renamed: ASP.NET v4.0, ASP.NET v4.0 Classic. And this is the key why Web Deploy fails.
#kzu: not trying, this will work.
Had the same problem when installing Orchard CMS. Keep targeting v2.0.
But find the simple solution: in IIS, on the Application Pools (the list with all application pools), you can find the 2nd setting top right list: "Set Application Pool Defaults.." change there the default from 2.0 to 4.0 et, voila.
Register ASP.NET for IIS
a. Run CMD as Admin
b. CD to \windows\microsoft.net\framework\v4.x
c. Aspnet regiis -i

My asp.net application needs the "IIS Metabase and IIS 6 Configuration Compatibility" - how to get rid of it?

Some while ago I've upgraded an asp.net 1.1 application (which ran on IIS 5 and 6) to .net 3.5 and later to .net 4.0 (and IIS 7.5)
Still, when I want to open it in VS, I need to install the "IIS Metabase and IIS 6 Configuration Compatibility". It works after I install it, but..
How to get rid of this requirement?
When debugging ASP.NET projects using Windows 7's IIS7.5 web server, Visual Studio 2010 RTM requires the IIS6 Metabase and IIS6 Configuration Compatibility components.
However Visual Studio 2010 SP1 fixes this dependency and VS2010 now works natively with IIS7.5 without any need to use the IIS6 bits.
I also proved this by knocking out a test project in Visual Studio 2003 and then copying to two different IIS7.5 machines configured as:
PC1: VS2010 RTM, no IIS6 Compatibility
PC2: VS2010 SP1, no IIS6 Compatibility
Here's a long-winded explanation (in case you need it) but the short answer (which also appears there) is to run
aspnet_regiis -ga <WindowsUserAccount>
I believe that this only happens when you upgrade a machine or you are not an administrator of the machine when you install .Net/Visual Studio. I recently had to do this on a brand new laptop with Visual Studio 2010 installed by others before I had admin rights. So, the way to get rid of this requirement from your end is to do the install as an admin.

Resources