2

I am working on an ASP.NET web site that for some reason does not use the Visual Studio "Cassini" mini-server but requires that IIS be installed and set up. It runs as "http://localhost".

I would like to change this, but can't find information as to how to change it. Is there a property somewhere? I looked in the Property Pages of the project, but it just shows two options for server : Default Server and Custom Server. Default Server is selected and Custom Server is grayed out.

I notice that my other web site projects, that DO use Cassini, also have Default Server checked, so that's not it.

It's a .NET 3.5 project that runs in Visual Studio 2010, so it's not a really old project. Also, it doesn't seem to have a project file.

I am just wondering if anyone knows how this feature is originally set/unset.

Cynthia
  • 2,100
  • 5
  • 34
  • 48

1 Answers1

3

In Visual Studio, if you right click your project, and look at Properties, you should see a Web section. In here, you can select the option "Use Visual Studio Development Server".

Also note that in here you can choose to use IIS, or use a Custom Web Server.

Are you seeing these options? If not then it's likely you have a Web Site project and not a Web Application project.

It's also possible that your project is being built to a directory that maps onto a Virtual Directory in IIS. In this instance, Visual Studio will attempt to use IIS - see http://msdn.microsoft.com/en-us/library/ckk1e6z4.aspx

dash
  • 89,546
  • 4
  • 51
  • 71
  • 1
    When I look at Properties for the project, I just see two properties: Full Path and Opened URL. When I look at the Property Pages, I see 6 sections: References, Build, Accessibility, Start OPtions, MSBuild Options, and Silverlight Applications. THe Start Options has a "server" section that only has two options: Use default Web server, and Use custom server. Nothing about Use Visual Studio Development Server. There is no "Web" section. – Cynthia Dec 05 '11 at 22:22
  • You are definitely using a Web Site project then. Take a look at the where the web site source files are on disk, then take a look and see if there is a virtual directory in IIS mapped to this same location. This could be the root of IIS or a subfolder. Also, out of interest, what happens if you run iisreset -stop from the command line then start debugging? – dash Dec 05 '11 at 22:32
  • This is actually my local working copy of an application under source control -- Team Foundation Server. But you are right -- it is now mapped in IIS to Default Web Site > _1 and also _2 (so that you get to it by going to http://localhost/_1 or _2 -- I ended up with two because I opened it twice and basically didn't know what I was doing.) Is there any way I can change it to just a file system? I don't really want it running in Inetpub which is where it seems to be located -- or where the virtual directory is? It's physically located in my TFS working directory. – Cynthia Dec 05 '11 at 23:45
  • You can remove the virtual directories in IIS - just right click, and remove them - see http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/b0da4e5b-0e87-4ddc-b6b3-8be3ecdfa927.mspx?mfr=true. Did you select HTTP when you created the project? If you did, then this is why they got added to IIS. – dash Dec 05 '11 at 23:47
  • I didn't create the project -- that's the problem! It was basically dumped in my lap .. :) Would removing the virtual directories take it out of the "http:" category? – Cynthia Dec 06 '11 at 00:24
  • OK I removed the virtual directories -- I thought. But now when I try to open the solution (which includes other projects) I get the following error -- http://localhost:8000 : error : Unable to open the Web site 'http://localhost/_2'. The Web site 'http://localhost/_2' does not exist. THe files are still there, but I can't seem to open the project any more. – Cynthia Dec 06 '11 at 00:29
  • @Cynthia the next best thing to do is to create a new blank web site project. Check it opens in Cassini. Then copy in the files from the other project to that folder and, in Visual Studio, show all files in the solution explorer, then right click and add to project. Alternatively, open the sln file in notepad and look for any occurrences of localhost/_2 and try removing those lines. To get hints back to how they were before, just readd the virtual directory in IIS. – dash Dec 06 '11 at 06:53
  • *"built to a directory that maps onto a Virtual Directory in IIS"* How do i see if a folder is mapped to a virtual directory in IIS Express? *"see if there is a virtual directory in IIS mapped to this same location"* How do i see if a virtual directory in IIS Express is mapped to a location? *"You can remove the virtual directories in IIS - just right click, and remove them"* How do you remove virtual directories in IIS Express? – Ian Boyd Apr 22 '19 at 19:30