How can I check whether with ASP.NET 4 is registered to run in IIS 7.5?
There must be some way to determine this for sure, other than running
aspnet_regiis -i
from within the framework's folder.
I don't need to check this programmatically, just via IIS Manager or the commend line. I have an .NET page that is returing a 500 error, which I have determined could be due to ASP.NET 4 not being registered with IIS.
However, I want to be certain before I make changes to the server configuration.
ASP.NET Version 4.5 is required. To check that ASP.NET is installed and registered with the correct version, enter the command aspnet_regiis.exe -lv at the command prompt. Version 4.5 should be displayed for ASP.NET.
Launch PowerShell as an administrator. Run the command import-module servermanager. ASP.NET 4.5: Run the command get-windowsfeature Net-Framework-45-Core. The output indicates the ASP.NET 4.5 install state ("Installed" or "Available").
Right-click on MicroStrategyWebPool and select Basic Settings. Select the . NET Framwork version and restart IIS to apply the changes.
Try to run aspnet_regiis
with parameter -lv
, i.e.:
C:\Windows\Microsoft.NET\Framework\v4.0.30319>aspnet_regiis -lv
This will give you the following output:
Microsoft (R) ASP.NET RegIIS version 4.0.30319.34209
Administration utility to install and uninstall ASP.NET on the local machine.
Copyright (C) Microsoft Corporation. All rights reserved.
2.0.50727.0 C:\Windows\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll
4.0.30319.0 C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll
4.0.30319.0 C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll
In this example, you can see that v4.0.30319.0
, 32 and 64 bit dll's, are installed.
To install the latest version, for example after applying a .NET Framework update, use
C:\Windows\Microsoft.NET\Framework\v4.0.30319>aspnet_regiis -iru
Note: On 64 bit IIS servers, you need to use "Framework64" instead of "Framework" in the paths above. Strangely, I found on some servers with 64 bit "Framework" in the path worked, on others I had to use "Framework64" - simply try it out. If the registration does not work, run it again with "Framework64" in the path, it does not harm. In one case, I had to change the path using cd C:\Windows\Microsoft.NET\Framework
, then I typed aspnet_regiis -iru
to make it finally work.
You mentioned that you need to check it programmatically: The command above can be used in a batch file, and via this article you can find the string "4.0.30319.0"
in the output (provided you're using "aspnet_regiis -lv > outputfile.txt" to write the output into a text file).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With