A personal repository of technical notes. - CSC

Server-Side Include "Failed to map the path"

In a VS2005 web site solution, the following server-side include:
<!-- #include virtual="/MyIncludeFile.inc" -->

throws the following error:
Failed to map the path '/MyIncludeFile.inc'.

Web site must be set up in solution as a "Local IIS" or with a Location of "HTTP" rather than "File System".

See quote from "Using IIS with VS 2005 and the new Web Project system - ScottGu's Blog":
The file-system tab option is great if you are working on a self-contained web project that requires no knowledge of the directory or URL structure of content outside its structure.

However, if you are using multiple nested IIS applications or special IIS virtual directory rules on your web server to coordinate multiple applications, then you should avoid opening up these projects using the file-system web option – and instead open them using the “Local IIS” or “Remote Site” tab options. The reason for this is because these nesting and relationship rules are stored in the IIS metabase, and for your application to properly run you will want/need these IIS bindings and semantics to be handled both at runtime and inside VS 2005.

See How to Convert "File System" web site to "HTTP" web site in VS2005

Local IIS Web Sites

Server-Side Include Directive Syntax

Using IIS with VS 2005 and the new Web Project system - ScottGu's Blog

No comments:

Post a Comment