.NET 4.5.2, IIS 8.5 on Windows 8.1 x64. I have a single ASP.NET web site at /localhost/. The DEFAULT website is disabled, a new site with was created with the right bindings. I am trying to pre-compile it in place:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319> aspnet_compiler -c -v /
error ASPRUNTIME: Failed to map the path '/'.
I tried the metabase-path route:
aspnet_compiler -c -m lm/w3svc/2/root
error ASPRUNTIME: Failed to map the path '/'.
I Can get it to compile by specifying the physical path but I don't want to do that because this same application exists on different servers with different physical paths (devs, QA, production). Not even the metabase paths are all the same. "/" is the same everywhere.
For grins I added this to a page in the site to make sure i wasn't losing my mind:
Response.Write(Server.MapPath("/"));
and got what I expected.
What am I doing wrong?
This is a rights issue; apparently you need to be administrator to access the IIS metabase. I see two possible solutions:
-p
to specify the physical path; that way aspnet_compiler
does not need to access the IIS metabase. (OP already explained this may not be a practical solution in a server cluster.)aspnet_compiler
from an elevated command prompt (i.e. "Run As Administrator"), as suggested here.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