Multiple web sites in VS/ASP.net

adcworks

Member
Joined
Jan 27, 2006
Messages
5
Programming Experience
5-10
I have 2 existing web sites implemented in ASP.net with VS.net 2003 but I got a new PC and can't for the life of me work out how to configure them up again!

What I need is to have my local IIS installation have multiple sites (for which I use IISAdmin tool). Therefore

http://project1
http://project2

would be distinct web applications.

My web application code for each project sit in

c:\project1
c:\project2

I have installed a fresh VS.net 2003 and now need to hook it onto these projects.

I use New > ASP.net Web Application, but the only option I get is to specify a URL. It wants me to use http://localhost/WebApp1 which is no use to me, I need http://project1 since if I were to use localhost, that would lock me to 1 IIS website.

Can anyone offer me advice on how to set this up? I thought about modifying my hosts file to have project1 point to localhost, and then add host headers into the IIS websites but not sure ...
 
Hi, no I mentioned that the http://localhost/WebApp1 style which is what you have suggested does not work for me. The main reason for that is that absolute URLs on things like images where I say <img src="/images/x.gif" /> will not work because they would need to be <img src="/WebApp1/images/x.gif" />. Obviously then, when deployed to a live server such as www.foo.com the /WebApp1 part no longer exists.
 
yeah but relative urls can get pretty ugly in the code.

are you saying that there is no way in asp.net development to develop for different IIS websites? seems a little wacky to me.

never have this problem in my java or php development cycle ...
 
adcworks said:
are you saying that there is no way in asp.net development to develop for different IIS websites? seems a little wacky to me.
No, I' m not the one saying that. In fact I develop for different ASP.NET websites on the same machines all the time. :)

I guess you are developing on Windows XP Pro or another non-server OS? In that case you should be aware that IIS on XP Pro has a limitation: you can not have more than 1 website running at the same time (though you can add them in the management console).

As an alternative you might consider other webservers then IIS.

Or you might check out this little tool.
 
Hi,

Yes the little tool you refer to I mention in my original post. I am indeed on XP Pro and I have setup the 2 websites I need with home directories pointing to the c:\project1 and c:\project2.

My issue is trying to get my new VS.net install to hook onto these web applications. It doesn't like http://localhost although I can't off the top of my head remember the precise issue it was having - i can come back to the post when I get home to fill that in.

It's very annoying that because they are essentially all localhost (because as you noted only one localhost:80 can be running) they are all labelled as such in VS.net rather than as a useful project name.

I'd love to use Apache but want to ensure I use the same web server as the production server does.

Thanks for your time so far.
 
Man, this is doing me in.

Basically when I do New Project, select Web Application, it defaults the location to

http://localhost/WebApplication1

I change this to http://mydomain (mydomain is an entry I added to my hosts file but it is essentially the same as localhost, I have an IIS website which I added a host header to handle mydomain - it works).

VS.net throws the following panic attack

"the default web access mode for this project is set to file share, but the project http://mydomain cannot be opened with the path \\mydomain\wwwroot$\ The error returned was unable to create web project '/' ... what would you like to do?

Well, I'd like to kill you VS.net for making appallingly little sense and causing white hair to appear on my head.

I thought this ASP.net was supposed to be easy?

I really have no clue what to do now :(
 
Back
Top