IIS7 .NET x64 aspnet_regiis -i causes class not re

2019-09-16 03:20发布

问题:

We are running IIS7 on Windows Server 2008 R2 SP1, with websites running on .NET 2.0. The websites work fine except that global themes do not work. I went ahead and tried to do aspnet_regiis -c in the Framework64 directory and got

An error has occured: 0x80040154 Class not registered. 
The error indicates that IIS is not installed on the machine. 
Please install IIS before using this tool.

If you are wondering, the enabled32bitApps flag is off, so .NET x64 is used. I went ahead and uninstalled (aspnet_regiis -u) and reinstalled (aspnet_regiis -i) .net in Framework64 folder successfully. Afterwards I got same result trying to run aspnet_regiis -c.

Does anyone have any idea what could be the problem here?

回答1:

I have found a easy workaround for this which does not include running the aspnet_regiis -c command. Under your default site in IIS, you should already have following directory structure:

aspnet_clinet --> system_web --> 2_0_50727 

All you have to do is copy your themes into ...\wwwroot\aspnet_client\system_web\2_0_50727\Themes on your file system and then create a IIS virtual directory "Themes" in aspnet_client\system_web\2_0_50727 which maps to your file system Themes directory.