views:

53

answers:

3

I recently reimaged my PC and regrabbed one of our projects from Source Safe. In our solution we have a web service that normally runs on a server, however we can build the webservice on our localhost for debugging as well. However, now whenever I grab the project from source safe it is building the webservice as a website instead of a developer web server.

This is causing a variety of issues, specifically I am no longer able to specify which port I would like that webservice to use. As a result I cannot connect to our database through my local webservice.

How can I change the project in my solution that controls the webservice from a website to a developer web server?

The project is using these technologies: MS Visual Studio 2005. MS Visual Source Safe 2005. MS SQL Server 2000. VB .NET project

EDITS:

This is just a clarification I made a comment below:

So to clarify even further, the solution contains multiple projects. One project is a web application in the sense that it contains a web service and web.config but the bulk of the files in the project is mostly app code.

A: 

Don't use SourceSafe.

Sjoerd
was not my choice to do so
stocherilac
A: 

There seems to be a fair amount of confusion here.

A "web service" is simply another file type which is part of a web site / web application. The "web server" is either going to be cassini (built into visual studio) or IIS. From your description it's highly unlikely you are building one of those.

If you mean to say that it is building as a web site instead of a web application, then most likely you haven't installed the VS2005 update to support Web Application Projects.

Of course, if that's the case, I'm kind of surprised it loaded the project without complaints to begin with.


More Information.

A "web application" is a very specific project type, which is different from a "web site". They deploy and compile down differently. The 2008/2010 versions of VS come with this distinction built in.

That said, the port number that a web application uses when it launches is controlled by the .vbproj file. This is controlled by right clicking on the project, selecting properties, then go to the Web tab. Under the servers section there is a "Specific Port" field. set that radio box and type in the number you want to use.

The port that a web site uses is controlled by clicking on the project and pulling up the properties sheet. From here you set "use dynamic ports" to false, and then set the port number you want it to run under. Note that you might have to save, click off to something else, then click back on the project name in order to get the properties tab to recognize that you made a setting change and allow you to set the port number.

You will also have to right click on the regular windows project and pick "Set as Startup Project" in order to get it to launch as the primary app instead of your web service.

Chris Lively
I have a windows client that uses a web service to access our database
stocherilac
So to clarify even further, the solution contains multiple projects. One project is a web application in the sense that it contains a web service and web.config but the bulk of the files in the project is mostly app code.
stocherilac
A: 

I figured it out. Turns out the issue was that IIS initially saw the webservice as a website. This caused Visual studio to set filepath in the properties for the project to 'http://localhost/project/'. By deleting the website from IIS and setting the filepath to file:///C:/path/project/ the properties window changes from listing itself as a website to a Developer Web Server. That means that the Opened URL is specified along with the path. In addition the Port number, dynamic ports option, and virtual path appear.

stocherilac
Sorry, it may "work" now, but you're still confused. The "ASP.NET development web server" is the piece of code that is part of Visual Studio that allows you to run and debug web sites, web applications and web services locally. It has nothing to do with what kind of project you have.
John Saunders
..... Explain to me then why visual studio displays the project in two different ways then. Thats like saying that there is nothing different as far as visual studio is concerned between a web application and a static website.
stocherilac
That property defines which type of *web server* runs your web site (note that you do NOT have a web application, that is an altogether different thing). In your case you just changed it from using your locally installed IIS to now use Cassini which is the web server built in to visual studio.
Chris Lively
Okay, that makes sense.
stocherilac
@stocherilac: there _is_ nothing different as far as Visual Studio is concerned between a Web Application and a static web site because Visual Studio has no concept of the site being static. The two types are "Web Application Project", which is created via `File->New Project` just like every other project type, and "Web Site", created by `File->New Web Site`. It has nothing to do with whether the site is static or not.
John Saunders