"Error 87, this option is not recognized in this context" using DISM to enable IIS

I am trying to use bat to let IIS run the asp.net application on a 64-bit Windows 7 machine (professional) and it seems to be constantly confronted with this problem. I run the bat file as administrator. The entry in my bat file that I use looks like this:

%systemroot%\sysnative\dism /online /enable-feature /all /featurename:IIS-ASPNET45

According to the documentation I read, all switches should include all the parent functions needed to run ASP.net 4.5. I also tried using only IIS-ASPNETand IIS-ASPNET40, everyone got the same error.

Error 87 the all option is not recognised in this context

At first I tried to perform each function necessary to run my application separately, but ran into similar problems.

+4
source share
2 answers

You have 2 problems. Firstly, the flag /allwas entered in Windows 8and therefore does not exist in Windows 7. Secondly, the function is IIS-ASPNET45also not part Windows 7, because it .Net 4.5came out after it.

What you need to do:

  • Include the specific features needed to IIS, using DISM:

dism.exe /NoRestart /Online /Enable-Feature /FeatureName:IIS-ApplicationDevelopment /FeatureName:IIS-CommonHttpFeatures /FeatureName:IIS-DefaultDocument /FeatureName:IIS-ISAPIExtensions /FeatureName:IIS-ISAPIFilter /FeatureName:IIS-ManagementConsole /FeatureName:IIS-NetFxExtensibility /FeatureName:IIS-RequestFiltering /FeatureName:IIS-Security /FeatureName:IIS-StaticContent /FeatureName:IIS-WebServer /FeatureName:IIS-WebServerRole
  • Register ASP.Net 4.5(assumes .Net 4.5already installed):

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe /i
+7
source

ERROR_INVALID_PARAMETER

87 (0x57) Invalid parameter.

The flag is /allnot recognized as a valid parameter.

dism /online /enable-feature /featurename:IIS-ASPNET /all

DISM @MSDN

See l3arnon answer .

0
source

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


All Articles