Archive for June, 2011

Do you get confused identifying which w3wp.exe to attach to in Visual Studio?

Two options for you:

Option 1 (from command prompt)

– In IIS 6: run %windir%\system32\cscript iisapp.vbs

– In IIS 7: %windir%\system32\inetsrv\appcmd.exe list wp

This should give you process id with the corresponding application pool you’re interested in.

Option 2

  1. Open Windows Task Manager
  2. Add PID and Command Line to the Processes tab
  3. Find the w3wp.exe processes
  4. Look for your application pool under the Command Line tab.  Make a note of the PID
  5. The PID is the ID of the process you need to attach to in Visual Studio

I prefer option 1 as it explicitly displays your list of application pools and process IDs.

Hope this helps to solve the frustration we sometimes go through when you have so many application pools running in IIS.


Custom Type in C# Settings

Today I was working on having custom type for settings in C# and I couldn’t see my type when I browsed for it in the Settings.settings visual designer in Visual Studio 2008.

I was able to get round the problem following the steps below:

1. Open your Settings.settings visual designer in Visual Studio.

2. Click on the dropdown for Type.

3. Click Browse… in the dropdown.

4. In Selected type: paste your full namespace. E.g. MyCompanyName.Project.SubProject.CustomType

5. Click OK and now you should have your custom type in your application settings.

If this help saves just one person some time, I’ll be happy!

Have a good day.

Categories: Uncategorized