Solved

# File In Virtual Directory Not Found

Posted on 2014-02-24
269 Views
Last Modified: 2014-02-27
Hello Experts,

I am running IIS 7.5 on Windows 7 and under my C:\inetpub\wwwroot I have two subfolders ABC and DEF representing different websites, which under IIS I have converted to applications.

within DEF I have a subfolder includes/common.asp.

Under IIS, for ABC I have created a virtual directory pointing at C:\inetpub\wwwroot\DEF\includes with the alias includes.

Now I am trying to run the following:
<!--  <!-- #include virtual = "/includes/common.asp" -->


But I am getting:
The include file '/includes/common.asp' was not found.


Any help will be greatly appreciated.
0
Question by:APD_Toronto
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points
• Learn & ask questions
• 15
• 13
28 Comments

LVL 33

Expert Comment

ID: 39883567
few things to check:

- double check the file name and the spelling of the virtual path
- make sure the virtual path is correctly set up. can you put in the browser /includes/common.asp and see if the file shows? if not, make sure the link in the virtual folder is pointing to the proper folder on your hard drive
- you have

<!--  <!-- #include virtual = "/includes/common.asp" -->

posted above. I assume the 2 opening tags is just a typo in the post?
0

Author Comment

ID: 39883601
When I go directly to http://localhost/DEF/includes/common.asp, I get:

HTTP/1.1 New Application Failed
0

LVL 33

Expert Comment

ID: 39883622
since you have 2 folders under your main website, but set up as different applications, that could be the issue. did you specify ports for either one?

what is the syntax for each site that you use to access the main page?
0

Author Comment

ID: 39883639
I think it's the fact I set them up as applications, how can I undo this?
0

LVL 33

Expert Comment

ID: 39883664
you'll need to delete them in IIS and start from scratch
0

Author Comment

ID: 39883865
I removed both applications and the HTTP/1.1 New Application Failed error disappeared, however, the first include not found still persists.

Since I removed the applications, I now see that under ABC I cannot add a Virtual Directory.
0

LVL 33

Expert Comment

ID: 39884073
what if you create the application for ABC, set up the virtual directory, and use the syntax you were using. does that work?
0

Author Comment

ID: 39884086
I will try that, but wasn't there a "convert to web"?
0

LVL 33

Expert Comment

ID: 39884098
i don't have an IIS 7 machine around so I can't answer that off the top of my head...I think there is, I'm just not sure where the option is.
0

Author Comment

ID: 39884115
When I try to include within the same site with the "file" keyword I get

The Include file '../includes/common.asp' cannot contain '..' to indicate the parent directory.

Can this be a permission issue?

You see, all of this worked before so I know that syntax is correct, and is working on my live environment, but this is my development machine and I needed to reformat it and now I am getting these errors.
0

LVL 33

Expert Comment

ID: 39884124
In IIS7, Parent Paths are disabled by default. You either need to use virtual paths or turn on parent paths in IIS
0

Author Comment

ID: 39884137
OK, physical path fixed-thank you, but the original path not found to the virtual directory still has errors. I did recreate the virtual directory after removing the application.
0

Author Comment

ID: 39884199
When I go to the virtual path's properties and test connection, I get the following. Does it say something?
Picture1.png
0

LVL 33

Expert Comment

ID: 39885743
looks like a permissions issue, try setting the NETWORK SERVICES account to have full permissions on the folder
0

Author Comment

ID: 39886025
The IIS_IUSRS has full control to ABC/includes. Is that what you mean?
0

LVL 33

Expert Comment

ID: 39886044
nope, there is an account called NETWORK SERVICES, that is the account the runs the default application pool in IIS. If it doesnt have permissions, it'll fail.
0

Author Comment

ID: 39886058
The Network Services user is not found.
0

LVL 33

Expert Comment

ID: 39886075
sorry, it's NETWORK SERVICE. It's a local user account.
0

Author Comment

ID: 39886097
but, how do I add/assign it
0

LVL 33

Expert Comment

ID: 39886153
do a search for it....in your screen shot, the word "services" is plural, it shouldnt be
0

Author Comment

ID: 39886166
OK, found network service, but when I try to grant fill control I get access denied. Yes, I am logged in as an admin.
0

LVL 33

Expert Comment

ID: 39886177
is it the local user account, or a domain one? make sure its the local user account. other than that, i'm not sure what the issue is other than you may not have full rights
0

Author Comment

ID: 39886262
its local.  I don't have AD

As well, my IIS is on the same PC as where I am trying to browse. In other words, there is no multiple PCs
0

LVL 33

Expert Comment

ID: 39886270
try googling "cannot add permissions for NETWORK SERVICE account"

I'm afraid I don't have much more time to work on this until tonight for you, sorry
0

Author Comment

ID: 39887353
Sorry, I misinformed you I was trying to apply full control to wwwroot, and the access denied was on the aspnet_client folder. However, my folder successfully has full control for network service.

With that said, the same error persists.
0

LVL 33

Accepted Solution

Big Monty earned 500 total points
ID: 39889011
Hmmm....I'm out of ideas then, you may want to Request Attention and see if you can get other experts involved.
0

Author Comment

ID: 39893053
I found something, hoping you can help me wrap it up...

As a reminder, both sites are in C:\inetpub\wwwroot\abc and C:\inetpub\wwwroot\def, and I created the virtual directory in def to point to abc, and the code failing is:

 <!-- #include virtual = "/includes/common.asp" -->


The reason why its failing, its looking for wwwroot/includes, and not def/includes.  Yes, I can add def, but this won't match my live environment, and  this used to work here before I reformatted.

So, the question is, how do I get /includes to point to def and not wwwroot?  Maybe, it goes back, how do I convert a folder to a website?
0

Author Closing Comment

ID: 39893334
Got it.  Thanks for your help
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

### Suggested Solutions

Title # Comments Views Activity
Adjust an existing ASP Query 45 28
Asp response.write to clients 6 45
PHP encrypted string and passing to a ASP Page 12 82
JQuery & Classic ASP 10 37
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Debug Tools to analyse IIS process: This article focus on taking memory dumps from IIS to determine which code is taking more time and to analyse which calls hangs/causes more CPU usage. To take dumps,download the following. Install1: To st…
Starting up a Project
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
###### Suggested Courses
Course of the Month8 days, 9 hours left to enroll

#### 739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.