views:

107

answers:

2

I want to attach to process on my iis. I don't want to force my iis configuration to my colleagues.

So how can I debug a web project, without storing its server config in the project meta data.

The options are iis or developer server, I want neither. Is there a little known hack in the meta data, outside of the UI that will just work?

+1  A: 

If I understand the question, you are running into the problem where your local changes to web.config keep getting checked into source control... so if you setup the compilation node for debugging in web.config then check it in, the change will affect other developers?

It is one of the more annoying things about web apps. The technique I use is to just beat the crap out of any of my developers that check in local settings to web.config.

Seriously though... one technique that I've used before is to just limit permissions in source control so that only a master admin account can check in changes to it.

Regular developers don't have rights to change that particular file in source control.

The devs manually remove the read-only flag for their local copy of web.config so they can make any necessary changes for their environments (connection stings, debug settings, etc)... but they cannot check in those changes by accident to source control.

If a change is really needed to the web.config file then we have to log in with the master admin account to make the change.

Stephen M. Redd
A: 

Hmm, I'd be interested to know what the default server for your project is - because surely it's one of those options?

Anyway. There's a "long way round" to what you want to do:

  1. In IIS Manager, point a site to the root of your project, getting the application up and running from there (if you're on WinXP, take a look at IISAdmin.Net, a great tool for setting up multiple sites on XP).
  2. From Visual Studio, build your site (or if it's a Web Site, make sure everything is saved).
  3. Request a page from the site in your browser of choice.
  4. In Visual Studio go to:
    1. Debug or Tools
    2. Attach to Process...
    3. Select w3wp
    4. Attach

You'll now be debugging the website worker process.

If you are running IIS on a remote machine and you're using VS2k8, you'll need to ensure you have the Visual Studio Remote Debugging Monitor installed on the remote computer - the files can usually be found in your VS2k8 install directory:

\Microsoft Visual Studio 9.0\Common7\IDE\Remote Debugger

(There's an installer around somewhere, but I can't seem to find it at the moment).

Zhaph - Ben Duguid