What is the Windows Server 2012 command line equivalent of `aspnet_regiis -ir`?

As described in several questions ( Alternative for registering ASP.NET 4.5 on Windows Server 2012 ; Server 2012 IIS 8 MVC application shows the default IIS homepage or 403/404 errors ; WCF on IIS8; *. .Svc handler does not work ), on Windows Service 2012, the aspnet_regiis -ir command no longer works and instead displays the following result:

This option is not supported on this version of the operating system. Administrators should instead install / uninstall ASP.NET 4.5 using IIS8 using the "Enable / Disable Windows Features" dialog box, server manager management tool, or the dis.exe command line tool. See http://go.microsoft.com/fwlink/?LinkID=216771 for more details.

In our case, we just want to run this command to re-register ASP.NET 4.5, as some other installation did not register it: ASP.NET 4.5 is already installed.

Using the user interface (adding / removing roles / functions) based on links, I found that it is enough to remove the WCF HTTP activation function and then add it again. (But I needed to remove / reinstall the function, which depends on the activation of HTTP WCF ...)

Question: How can this be done on the Windows Server 2012 command line?

(I looked at this thing dism.exe , but it looks complicated, and dism.exe -? n't help me at all.)

Thanks!

+6
source share
3 answers

Dism is the best way to do this:

 Dism /online /Disable-Feature /FeatureName:WCF-HTTP-Activation45 Dism /online /Enable-Feature /FeatureName:WCF-HTTP-Activation45 

Use the / all switch to enable all parent functions.

+4
source

This error occurs when you install the .NET Framework using .NET 3.5 on top of CLR 2.0, including HTTP activation on a Windows 2012 or 2012 R2 server that already has .NET framework 4.5 installed.

In our case, the proposed fixes do not work.

We had a CLR 4.0 website that showed an error:

 Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly 'System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' 

Removing and re-adding ASP.NET 4.5 features did not matter.

We had to remove and add 3.5 again using DISM:

 Dism /online /Disable-Feature /FeatureName:WCF-HTTP-Activation Dism /online /Enable-Feature /FeatureName:WCF-HTTP-Activation 

You can also use PowerShell:

 Remove-WindowsFeature -Name NET-HTTP-Activation Add-WindowsFeature -Name NET-HTTP-Activation 
+2
source

To add / remove roles / features you need to use the Server Manager control panel. Look for IIS → WebServer → Application Development → ASP.NET 4.5

0
source

Source: https://habr.com/ru/post/944887/


All Articles