ASP.NET - Missing #includes cause compilation errors: Failed to map the path '...'

Posted by frankadelic on Stack Overflow See other posts from Stack Overflow or by frankadelic
Published on 2010-05-26T00:10:48Z Indexed on 2010/06/03 17:14 UTC
Read the original article Hit count: 549

I have an ASP.NET application which features some server-side includes. For example:

<!--#include virtual="/scripts.inc" -->

These files are not present in my ASP.NET website project because my website starts in a virtual directory:

/path-to-my-application

When I choose Build Web Site, I get this error:

Failed to map the path '/scripts.inc'

Visual Studio cannot resolve these include files that are defined at the root directory level. They are not visible in the website project.

Aside from manually commenting out the #include references, is there any way I can get the website to build? Can I force Visual Studio to ignore those errors and compile the site?

Once the website is pushed out to IIS, there is no problem, because all the #include files are in place.

NOTE - Web Controls are not an option for this application. Please assume #include files are a requirement. Also, I cannot move the include files since they are used by other applications.

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about visual-studio-2008