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.
###### Who is Participating?

Senior Web Developer / CEO of ExchangeTree.org Commented:
Hmmm....I'm out of ideas then, you may want to Request Attention and see if you can get other experts involved.
0

Senior Web Developer / CEO of ExchangeTree.org Commented:
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 Commented:
When I go directly to http://localhost/DEF/includes/common.asp, I get:

HTTP/1.1 New Application Failed
0

Senior Web Developer / CEO of ExchangeTree.org Commented:
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 Commented:
I think it's the fact I set them up as applications, how can I undo this?
0

Senior Web Developer / CEO of ExchangeTree.org Commented:
you'll need to delete them in IIS and start from scratch
0

Author Commented:
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

Senior Web Developer / CEO of ExchangeTree.org Commented:
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 Commented:
I will try that, but wasn't there a "convert to web"?
0

Senior Web Developer / CEO of ExchangeTree.org Commented:
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 Commented:
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

Senior Web Developer / CEO of ExchangeTree.org Commented:
In IIS7, Parent Paths are disabled by default. You either need to use virtual paths or turn on parent paths in IIS
0

Author Commented:
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 Commented:
When I go to the virtual path's properties and test connection, I get the following. Does it say something?
Picture1.png
0

Senior Web Developer / CEO of ExchangeTree.org Commented:
looks like a permissions issue, try setting the NETWORK SERVICES account to have full permissions on the folder
0

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

Senior Web Developer / CEO of ExchangeTree.org Commented:
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 Commented:
0

Senior Web Developer / CEO of ExchangeTree.org Commented:
sorry, it's NETWORK SERVICE. It's a local user account.
0

Author Commented:
but, how do I add/assign it
0

Senior Web Developer / CEO of ExchangeTree.org Commented:
do a search for it....in your screen shot, the word "services" is plural, it shouldnt be
0

Author Commented:
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

Senior Web Developer / CEO of ExchangeTree.org Commented:
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 Commented:
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

Senior Web Developer / CEO of ExchangeTree.org Commented:
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 Commented:
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

Author Commented:
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 Commented:
Got it.  Thanks for your help
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.