Reputation: 9078
I'm getting this really annoying error when trying to set up a new application in IIS 7.5 on Windows Server 2008 R2.
I'm adding a new application under the default website in IIS 7.5, myappname
I have the application pool for the application set to ASP.NET v4.0
I've tried copying the files from another application that is working on the same server, different website, and it still fails, so I don't think it has anything to do with the web.config settings.
If I browse to http://localhost/myappname (or browse to any file/path under that application) I get the below error:
Server Error in '/myappname' Application.
Failed to map the path '/myappname'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: Failed to map the path '/myappname'.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[InvalidOperationException: Failed to map the path '/myappname'.] System.Web.HttpRuntime.HostingInit(HostingEnvironmentFlags hostingFlags, PolicyLevel policyLevel, Exception appDomainCreationException) +336 [HttpException (0x80004005): Failed to map the path '/myappname'.] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +11700992 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +141 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +4869221
I really don't get it. ALSO - if I go to the "Edit Application" dialog, and use the "Test Settings" button, then I get a error:
"There was an error while performing this operation. Details: Invalid application path"
which is BS, because I selected the path using the ...
button to browse for the path.
Also, that same error occurs when I use the "Test Settings" button on some of the other working websites on the server, so I'm not sure what to make of that and whether it's even relevant.
Upvotes: 2
Views: 15523
Reputation: 1319
your problem is not clear from the question. I can suggest the following solution. try your best
1.check whether your application pool is running in Integrated mode.
2.If you have a default route mapped then try right click the application in IIS => manage application =>browse
3.Try Adding RegisterRoutes(RouteTable.Routes); in the Application_Start() in global.asax
Upvotes: 1