Solved

Posted on 2014-02-24
264 Views
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
• 15
• 13

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

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
Lync server 2013 or Skype for business Backup Service Error ID 4049 – After File Share Migration
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…