Link to home
Start Free TrialLog in
Avatar of cyborama
cyboramaFlag for United States of America

asked on

setting up an existing application in iis7.5 windows 7 ultimate

Hello There,

I have been trying to get an existing application I have on a hosting service to work correctly on my windows 7 ultimate under iis7.5.  I had a very easy time of it when I was using iis 5 under windows xp but have run into several snags trying to set this up under integrated asp net 4.0

The first problem that occured was when I left the default website pointing to inetpub\wwwroot and had my application pointed to a different subfolder outside the wwwroot. In this case the application came up under localhost but all the relative links were broken which I found was do to the fact that in iis you never can specify something should be relative to an application root only to the site root.

The second problem came when I tried to make the site root point to point to either a subfolder in wwwroot which contained the application files including the web.config file or when I pointed to a subfolder outside wwwroot.  In either case I got the same error even though correct permissions were granted on both these folders for the respective apppool inet users, etc..

The error message I got is listed below:
""The resource you are looking for has been removed, had its name changed, or is temporarily unavailable."

The Module is IIS Web Core
Notification: MapRequestHandler
Handler: StaticFile
Error Code:0x80070002
Requested URL: http://localhost:80/berkshires/
Physical Path c:\inetpub\wwwroot\berkshires\berkshires\

Now the first thing I notice here is that the physical Path is certainly not the path that I pointed the default website to as it was inetpub\wwwroot\berkshires and not a subfolder berkshires inside of a folder berkshires. Not sure why this happens when I declare the web site root in IIS7.5 as a subfolder but it does.

The next thing I tried to do is create an application inside my default website and point that application to a folder call berkshires outside of the wwwroot as well as folder contained inside of it while my default website pointed to the berkshires folder inside the wwwroot and I got the server error 500.19 in regards to not being able to add cuplicate entry types which is logical given that the application also inherits from the website and since they are both pointing to folders containing the same web.config file with the same details it makes sense that it would detect duplicates.

In my last attempt to get this site to work properly on my localhost with relative links starting at the subfolder that I wanted the root to start in was to try to follow that maphandler problem by actually creating a folder called berkshires inside of a parent folder berkshires and point the default website to the parent folder berkshires and go to the site and see if I could get it to render properly.

In other words I pointed the default web site to go to inetpub\wwwroot\berkshires while I put the application files in inetpub\wwwroot\berkshires\berkshires since this was where the maprequesthandler was telling me the physical path was.

In this case I got a configuration error that stated the following:
"It is an error to use a section registered as allowDefiniton="MachineToApplication" beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.

The line that was singled out as a response to this error in my webconfig file was the line where their was a <machinekey tag with attributes validationKey, decryptionKey, dectryption, validation.

Not sure why this was thought to be problematic under this trial set up but it was.

To sum it all up the only way I could remotely even get my application to run on my localhost under windows 7 ultimate was to point the default website to inetpub\wwwroot while pointing the application to a subfolder either in the wwwroot folder or somewhere outside of this folder.

Of course as mentioned the problem here was broken relative links so I am not sure what I am doing wrong as to why when I try to point the default website root to where the web.config file actually is I get this machinerequesthandler error under statichandler and when I try not to point it to the directory that contains my web.config file I simply get an application that is starting at the sites root as the starting path hence breaking all my links.  So instead of wiring relative links to localhost/subfolder as the starting point it has to start the wiring from localhost/ hence breaking the links and again when I fix that by making the website root the subfolder I want the wiring to start from I get these other iis errors.

So any help in trying to get this application running in my localhost with links that are not breaking would be great.

By the way sometimes I found that is I have the application working with the method dexcribed above that allows it to work with broken relative links I find that I can go to the iis and than change the path of my default site root to the same folder that the application within this default site root was pointing too than if I delete the application inside the default website and refresh my website I can for a time get relative links to resolve properly but just as soon as I either recycle the apppool this application is using or close the browser and revisit this localhost site than I am back to square one with the maprequesthandler syndrome.

So thanks again for your help in this regard,

Avatar of strickdd
Flag of United States of America image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of cyborama


that was ingenius I guess I was just use to iis 3 and 6 where you could set the application to a subfolder and navigate to that sub folder and have it work.

So now the next question is this.  Is their a way to set up multiple localhost sites via windows 7 ultimate.

For example say I have a site called a, b, and c.

Isn't their some way where I could set up iis so that if I wanted to go to localhost/a it would bring me to site a or if I want to go to localhost/b I would go to site b, etc...

I figured by using sub folders I could achieve this purpose but as I found out this was not the case.  I see that you can create multiple sites via iis 7.5 by adding another site in iis manager but I am confused on how I might achieve navigating to these different sites that I may set up because if I have a site pointing to folder a in the wwwroot inside inetpub and another site pointing to folder b in wwwroot within inetpub how could I navigate to one or the other since typing http://localhost would most likely just resolve to where the default web site was pointing.

Any ideas on this thanks and also thanks for helping me through getting at least an initial site up and running via development

Hello everyone,

Here is a piece of the update to the dnncreative magazine forum and the dotnetnuke forum which posed some of the same questions I did to you guys here but they couldn't figure it out really because they probably weren't quite as in tune with the functionality of IIS 7.5 as you are in this area of expert exchnage.  At any rate I wanted to paste this piece of the comment I sent to them because it asks questions sort of like is above but I am more or less trying to wrap my mind around why how I accomplished a localhost set up in iis5 and 6 did not work in iis 7.5 using the same principles I used their. Yes design was different and difference in the way you wired up the site and application but I am trying to understand why the hiicup in iis 7.5 when their was non in iis 5 doing things the same way here it goes between the dotted lines.
I guess what I don't get though is why when you point the website root and application to the same folder with alais you want to use the site and application reading the web.config file throws a duplication error because isn't that sort of like what you were doing in iis5 and iis 6 when you right clicked on website went to properties and made home directory the path to the folder with your application files.

Than when you spun off a virtual directory with alias of what you wanted to use after localhost from this default website and pointed it to this same folder you pointed the home directory to aren't you basically doing the same thing as you do in iis 7.5 when I attempted to point default site to sub folder and application to the same folder yet in iis5 their was no duplication error when both the site and application were pointed to the same location yet in iis 7.5 there is.

Thanks for listening and any comments you may have on this subject of setting up multiple sites in iis7.5 in a localhost type of environment


Yes, you can have multiple sites, you need to specify ports or edit your host file and set the subdomain in iis.
ok thanks for all your help strickdd
great help, answered my question perfectly.

Thanks for your quick responses