Search code examples
iiswindows-8.1asp.net-2.0aspnet-regiis.exe

aspnet_regiis -c 0x80040154 Class not registered


I have a weird issue with windows 8.1 and .NET 2 (yes I have to use it for this project). Running aspnet_regiis -c for .NET 4.5 gives no errors and says it copied the client side files correctly. When I go into the .NET 2 folder it gives this error:

C:\Windows\Microsoft.NET\Framework\v2.0.50727>aspnet_regiis -c
Start copying the ASP.NET client script files for this version (2.0.50727).
An error has occurred: 0x80040154 Class not registered

The error indicates that IIS is not installed on the machine. Please install IIS
 before using this tool.

I have done some reading and one answer on SO says:

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.

Link: IIS7 .NET x64 aspnet_regiis -i causes class not registered error

I don't know if this is actually a good solution, especially since this seems to be a compatibility issue between .NET 2 and Windows 8.1. Is there another work around for this?


Solution

  • Disclaimer

    First, let me preface this answer by saying that I don't really know what the command aspnet_regiis -c is supposed to do. The aspnet_regiis documentation is kind of vague - it says that client side scripts are supposed to be installed, but it doesn't give any information on those scripts.

    In any case, when I ran it on an earlier OS (Win 2003 Server), all it did was create some empty directories (and did not actually copy any scripts into them).

    This answer resolves the error you are seeing and allows Windows 8.x to do the same as Win 2003 - that is create some empty directories under your web application directory. However, I don't know if that actually allows your application to do what it needs to do.

    Getting to your problem

    The .Net 2 aspnet_regiis -c command assumes that the IIS Administration Service is installed. This is a legacy service from IIS 6 that is of course not installed by default in Windows 8.x.

    You can install this service by going to Programs and Features in the Control Panel and enabling the IIS 6 Management Compatibility feature, as well as it's sub-items:

    Enable IIS 6 Management in Programs and Features

    After you do the above, you should be able to run the command:

    C:\Windows\Microsoft.NET\Framework64\v2.0.50727> .\aspnet_regiis.exe -c
    Start copying the ASP.NET client script files for this version (2.0.50727).
    Finished copying the ASP.NET client script files for this version (2.0.50727).
    

    As I said before, all this does is create empty folders under your web apps and may or may not actually solve your problem. Just as an example, it will create the following directory structure assuming you have only the default IIS web app:

    C:\Inetpub\wwwroot\aspnet_client\system_web\2_0_50727