Jaa


Errors installing ASP.NET 4.0

Here is a little problem you might run into when trying to use aspnet_regiis.exe to register ASP.NET 4 on a site.

C:WindowsMicrosoft.NETFrameworkv4.0.30319>aspnet_regiis -i
Start installing ASP.NET (4.0.30319).
.......
Finished installing ASP.NET (4.0.30319).
Setup has detected some errors during the operation. For details, please read the setup log file C:UsersjohnAppDataLocalTempASPNETSetup_00003.log

C:WindowsMicrosoft.NETFrameworkv4.0.30319>

When you look into the mentioned log file and search for “fail” you find this:

2010-09-06 14:27:18 Failure Changing IIS ApplicationHost.config: IIS7Register failed with HRESULT 800700b7: 'Cannot create a file when that file already exists. '

So what’s that all about?

Turns out it is actually down to the fact that aspnet_regiis.exe does not cope too well with the generally accepted environment variable that expands to the Windows directory. So when you look in your applicationHost.config file (in windowssystem32inetsrvconfig) you may find something like this:

<isapiCgiRestriction>
             <add path="%windir%system32inetsrvasp.dll" allowed="true" groupId="ASP" description="Active Server Pages" />
             <add path="%windir%Microsoft.NETFramework64v2.0.50727aspnet_isapi.dll" allowed="true" groupId="ASP.NET v2.0.50727" description="ASP.NET v2.0.50727" />
             <add path="%windir%Microsoft.NETFrameworkv2.0.50727aspnet_isapi.dll" allowed="true" groupId="ASP.NET v2.0.50727" description="ASP.NET v2.0.50727" /> 
             <add path="%windir%Microsoft.NETFrameworkv4.0.30319aspnet_isapi.dll" allowed="true" groupId="ASP.NET v4.0.30319 (32-bit)" description="ASP.NET v4.0.30319 (32-bit)" />
             <add path="%windir%Microsoft.NETFramework64v4.0.30319aspnet_isapi.dll" allowed="true" groupId="ASP.NET v4.0.30319 (32-bit)" description="ASP.NET v4.0.30319 (32-bit)" />
             <add path="%windir%system32inetsrvwebdav.dll" allowed="true" groupId="WEBDAV" description="WebDAV" />
</isapiCgiRestriction>

If you change the highlighted bits to the appropriate hard coded location (e.g. c:windows ) and try again you should find it works.

HTH

Doug

Comments

  • Anonymous
    October 26, 2011
    This was great! Thanks a lot!

  • Anonymous
    February 19, 2012
    This is exactly what I needed.  Worked perfectly after following your steps.  Thanks a ton!!

  • Anonymous
    February 19, 2012
    Glad it helped!

  • Anonymous
    February 28, 2012
    Worked for me. Thank you very much.

  • Anonymous
    March 15, 2012
    Thanks !!!!

  • Anonymous
    December 03, 2012
    Thanks very much for this, help me out.

  • Anonymous
    December 19, 2012
    This helped a lot. Thanks verymuch for the post

  • Anonymous
    March 30, 2013
    The comment has been removed