Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

aspnet_compiler Failed to map the path '/'

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

like image 453
n8wrl Avatar asked Oct 01 '13 17:10

n8wrl


1 Answers

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.
like image 200
Ruud Helderman Avatar answered Oct 05 '22 02:10

Ruud Helderman