aspnet_compiler Failed to map the path '/'
Asked Answered
H

1

7

.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?

Hudak answered 1/10, 2013 at 17:36 Comment(1)
I opened a case with one of my MSDN support credits and was unable to resolve this.Hudak
S
4

This is a rights issue; apparently you need to be administrator to access the IIS metabase. I see two possible solutions:

  1. Use -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.)
  2. Run aspnet_compiler from an elevated command prompt (i.e. "Run As Administrator"), as suggested here.
Semiology answered 17/7, 2018 at 9:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.