PowerShell ASP: Could not load file or assembly nsoftware.PowerShellASP in IIS.
When creating a handler mapper to support PowerShell ASP in IIS you can sometimes get the following error:
Could not load file or assembly nsoftware.PowerShellASP or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded. (c:\windows\microsoft.net\framework64\v2.0.50727\config\web.config line 59)<br />
This error occurs when PowerShell Server was installed with PowerShell 3.0 support but the IIS Application Pool using the PowerShell ASP handler mapping is configured to run under .NET 2.0. Because PowerShell 3.0 requires .NET 4.0 this error is generated.
To resolve this issue all you must do is set the Application Pool to use .NET 4.0. This can be done by the following steps:
- In IIS, expand the Server branch.
- Select “Application Pool”.
- Right-click the Application Pool being used for your PowerShell ASP site and select “Basic Settings”.
- Under the “.NET Framework Version” select the .NET 4.0 option (e.g., “.NET 4.0.30319″)
- Click “OK”.
- Restart IIS.
We appreciate your feedback. If you have any questions, comments, or suggestions about this article please contact our support team at firstname.lastname@example.org.