Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IIS Express on a shared development machine (rdp)

I have a problem which I thought could be common, searched the web for it but found nothing.

We're using a shared development machine, and every developer connects through RDP and has his own profile, desktop, etc.

The problem I am encountering is with IIS express. Since it is configured at user level (applicationhost.config inside documents/iisexpress/config) and the port configured must match the one declared in the .csproj file, two developers can't possibily run on the same port, as it gives the error "the port is already in use".

So to make it work we have to manually change the port both on the csproj and in the applicationhost.config for every developer, but it's only a temporary fix as when we commit our changes to SVN, the csproj file gets merged, so we have to do this process every time someone commits/updates.

My question is: is there a clean way to use IIS express with Visual Studio 2010 on a shared development machine?

Thanks.

like image 371
Matteo Mosca Avatar asked Dec 21 '11 10:12

Matteo Mosca


People also ask

Can IIS Express be accessed remotely?

IIS Express doesn't allow remote connections to locally hosted websites as default. Luckily, Ionut-Cristian Florescu developed a small tool called iisexpress-proxy. As the name already spells out, iisexpress-proxy is a simple local proxy for IIS Express. The app is based on node.

What is iis10 Express?

Internet Information Services (IIS) 10.0 Express is a free, simple and self-contained version of IIS that is optimized for developers. IIS 10.0 Express makes it easy to use the most current version of IIS to develop and test websites.

How do I debug IIS from Visual Studio?

In the Visual Studio toolbar, make sure the configuration is set to Debug, and either IIS Express, or the new IIS profile name, appears in the emulator field. To start debugging, select IIS Express or <IIS profile name> in the toolbar, select Start Debugging from the Debug menu, or press F5.


1 Answers

Partially tested answer. Not sure how it'll work on a multi-user workstation. It might give you, or someone else here, a jumpstart to a proper solution that works best in your existing environment.

It appears that Visual Studio stores all the web configuration in the csproj/vbproj and IISExpress stores its configuration in %userprofile%\Documents\IISExpress\config\ApplicationHost.Config.

Normally, we store the csproj files in source control, but ignore the csproj.user file so that each person may have some unique settings, such as the web configuration.

  • Each user who signs into the box must have their own profile.
  • Each profile must have their own copy of the source code.
    • Each user's copy of the source will contain their own csproj.user file.
  • Ignore .**proj.user* files in your source control.

Copy the web settings into the csproj.user by unchecking the option Apply server settings to all users and then commit to source control. unchecking the option Apply server settings to all users

Each user who pulls a copy of the source will have to configure their web settings, use a unique port that the others users are not using, and uncheck the box above so that their configuration is not passed on to the other users.

Doing this, Each profile will have their own IIS Express ApplicationHost.Config configured with a port that is different from the other profiles. Each user's copy of the source will have a csproj.user that is configured with the same port in their profile's IIS Express configuration.

For reference:

I've tried changing IIS Express's ApplicationHost.Config to use a different port than what Visual Studio expects and Visual Studio is unable to connect the debugger to IIS Express.

How IIS Express's configuration works: http://msdn.microsoft.com/en-us/library/ms178109.aspx

like image 96
Nick VanderPyle Avatar answered Sep 24 '22 22:09

Nick VanderPyle