Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Starting .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.) RESTful web service hosted in another ASP.Net application

We want to simply start the projects in Debug mode (F5) and have A consume data from B through Ajax. We do not have the possibility to configure IIS on all development machines (because some of them are on the client's side). The problem might be that JavaScript needs to be in the same domain as the URL it posts to.

Is there any way we can use Visual Studio 2010 Development Server to start both applications simultaneously in debug mode on the same port?

If this is not possible, what is the next best thing you can recommend?

like image 807
Germstorm Avatar asked Jul 19 '12 14:07

Germstorm


1 Answers

We solved this problem by installing IIS on the development workstation. In each Visual Studio project, on the Web property page, select Use Local IIS Web server. Do not check Use IIS Express. The Project URLs will be set to http:localhost/<projectname> (note: in the same domain). You’ll be prompted to Create a Virtual Directory for each. Each will be assigned to the default IIS app pool. Open the Internet Information Services (IIS) Manager. Click Application Pools on the left pane. On the right pane add another integrated application pool. For one of the applications, open the Advanced Settings... In the properties view select the app pool you just created as the application pool. The applications should be debuggable in parallel because each Application Pool spawns a new operating system process to which a separate debugger can be attached.

like image 192
lenrussell Avatar answered Oct 26 '22 06:10

lenrussell