ASP.NET - Missing #includes cause compilation errors: Failed to map the path '...'
- by frankadelic
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.