Solved

File In Virtual Directory Not Found

Posted on 2014-02-24
28
270 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" -->

Open in new window


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

Open in new window


Any help will be greatly appreciated.
0
Comment
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

by:Big Monty
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

by:APD_Toronto
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

by:Big Monty
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
Free NetCrunch network monitor licenses!

Only on Experts-Exchange: Sign-up for a free-trial and we'll send you your permanent license!

Here is what you get: 30 Nodes | Unlimited Sensors | No Time Restrictions | Absolutely FREE!

Act now. This offer ends July 14, 2017.

 

Author Comment

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

Expert Comment

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

Author Comment

by:APD_Toronto
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

by:Big Monty
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

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

Expert Comment

by:Big Monty
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

by:APD_Toronto
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

by:Big Monty
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

by:APD_Toronto
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

by:APD_Toronto
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

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

Author Comment

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

Expert Comment

by:Big Monty
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

by:APD_Toronto
ID: 39886058
The Network Services user is not found.
Network Services not found
0
 
LVL 33

Expert Comment

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

Author Comment

by:APD_Toronto
ID: 39886097
but, how do I add/assign it
0
 
LVL 33

Expert Comment

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

Author Comment

by:APD_Toronto
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

by:Big Monty
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

by:APD_Toronto
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

by:Big Monty
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

by:APD_Toronto
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

by:
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

by:APD_Toronto
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" -->

Open in new window


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

by:APD_Toronto
ID: 39893334
Got it.  Thanks for your help
0

Featured Post

Free NetCrunch network monitor licenses!

Only on Experts-Exchange: Sign-up for a free-trial and we'll send you your permanent license!

Here is what you get: 30 Nodes | Unlimited Sensors | No Time Restrictions | Absolutely FREE!

Act now. This offer ends July 14, 2017.

Question has a verified solution.

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

What is an ISAPI filter?   •      It's an assembly (.dll file) that can add or change the way IIS works.   •      They can be enabled globally for your web server or on a site-by-site basis.   When the IIS server receives a request, enabling the ISAPI fi…
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

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

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

Join & Ask a Question