Reputation: 95
I am trying to do what is suggested in the answer here: How do I set the .NET Framework Version when using New-WebAppPool?
and using the command:
Set-ItemProperty C:\inetpub\temp\appPools\DefaultAppPool managedRuntimeVersion v4.0
I get this error however
Set-ItemProperty : Property System.String managedRuntimeVersion=v4.0 does not exist. At line:1 char:17 + Set-ItemProperty <<<< C:\inetpub\temp\appPools\DefaultAppPool managedRuntimeVersion v4.0 + CategoryInfo: ReadError: (System.String managedRuntimeVersion=v4.0:PSNoteProperty) [IOException + FullyQualifiedErrorId :SetPropertyError,Microsoft.PowerShell.Commands.SetItemPropertyCommand
I think that I loaded the Web Administration module correctly (right clicked on the taskbar icon and selected "Import System Modules" and then tried the commands in that shell) and I've also tried using the command and explicitly stating the parameters and it still occurs. Same problem happens with other properties like AutoStart.
Does anyone know what I might be doing wrong?
Upvotes: 3
Views: 5602
Reputation: 301587
C:\inetpub\temp\appPools\DefaultAppPool
- you are pointing to the filesystem.
Use the IIS provider to point to the App Pool.
It will be something like IIS:\AppPools\Name
Upvotes: 1
Reputation: 52699
C:\
is the from the file system provider. Keith's answer in the SO question you linked is using the IIS provider IIS:\
.
Set-ItemProperty IIS:\AppPools\<pool_name> managedRuntimeVersion v4.0
Upvotes: 5