Running the .Net web service on the same port as the ASP.Net application

We have a simple Visual Studio solution containing 2 projects:

  • A.) Simple ASP.Net website.
  • B.) A RESTful web service hosted in another ASP.Net application.

We want to just run projects in debug mode (F5) and use data A from B to Ajax. We have no way to configure IIS on all development machines (because some of them are on the client side). The problem may be that JavaScript must be in the same domain as the URL to which it points.

Can I use Visual Studio 2010 Development Server to run both applications simultaneously in debug mode on the same port?

If this is not possible, what is even better, what can you recommend?

+7
source share
2 answers

We solved this problem by installing IIS on a development workstation. In each Visual Studio project, on the Web properties page, select Use Local IIS Web Server. Do not test the use of IIS Express. The project URL will be set to http: localhost / <projectname> (note: in the same domain). You will be asked to create a virtual directory for each. Each will be assigned a default IIS application pool. Open Internet Information Services Manager. Click Application Pools in the left pane. In the right pane, add another federated application pool. For one of the applications, open the advanced settings ... In the properties window, select the application pool that you just created as the application pool. Applications must be debugged in parallel because each application pool generates a new operating system process to which a separate debugger can be attached.

+1
source

Yo will not be able to host different applications on the same port in the Cassini instance, there are tools that might be useful, but I would leave Cassini to host them on different ports, which is his usual behavior.

Parameters (not verified):

UltiDev

Cassini extesion

By the way, I don’t know if you know this, but to launch both projects go to Install launch projects , there is an option in the context menu of Solution . p>

0
source

All Articles