tags:

views:

43

answers:

2
A: 

Create a virtual directory. You can do this by going into the project properties window in VS and selecting the Web tab. This works for Web application projects, so I'm guessing that it will work for the Web site as well.

IrishChieftain
+1  A: 

This is a very common problem for new .NET web developers. This is how I do it on XP Pro but should be similar for other OSs too. Hope this helps.

  • Settings>control panel>administrative tools>Internet Information Services
  • Find your default web site (or where ever you want the vDir)
  • Right-click>New>New Virtual Directory

From here, you will need to create an alias (usually the same as the root folder for the new site) then put in the path for the site.

Then you should be able to access the site http://[your server]/[alias]/[mainpage].aspx

J.Hendrix
I have tried this method also.When I create virtual directory and run my website, I can not access my database(MS SQLserver 2005). It gives a login failed exception.But when i run the same website using visual studio then no such database login failed exception occurs.
Akshay
If you have WindowsAuthentication set to True, when running under Visual Studio, you are running as yourself. When running under IIS, you are running as a very low privileged user, that likely does not have access to your SQL database. Change your SQL connection string to specifiy a specific username and password.
Jason Berkan
@Akshay, You can set the web application to use the users domain account to access the SQL Server. Depending on what you are doing, you may want to create a new user on the SQL Server with the minimum access needed (ie read-only) and connect to the server using a connection string from your web.config file. This link might help you. http://msdn.microsoft.com/en-us/library/ms178411.aspx
J.Hendrix