3
votes

I have been using IIS express as my web server for awhile now, but I've run into a scenario where I need the application pool to run as a specific user, rather than NetworkService or some other account.

Using the commands below, I created an app pool and configured the site to use it. Now, I'm unable to launch IIS Express as through Visual Studio. When I try, I get the "Visual Studio is unable to launch the IIS Express Web Server" message. If I use the command line to launch IIS Express, everything appears to work. If I change the app pool back to using a service account, or even just change the site to use a different app pool, things work just fine. Any ideas?

commands used to create the app pool

appcmd add apppool /name:MyPool /managedRuntimeVersion:v4.0 /managedPipelineMode:Integrated
appcmd set config /section:applicationPools /[name='MyPool'].processModel.identityType:SpecificUser /[name='MyPool'].processModel.userName:'MyUser' /[name='MyPool'].processModel.password:MyPass
appcmd set app /app.name:MySiteName/ /applicationPool:MyPool

command used to launch iisexpress.exe manually

iisexpress /config:c:\users\me\documents\iisexpress\config\applicationHost.config /trace:error

I've tried reinstalling both IIS Express and Visual Studio 2010 SP1. No difference.

2
Don't know if it will matter, but I'm running Win 7 Enterprise x64.Josh

2 Answers

6
votes

Just an idea: since the problem is likely to be security-related, I'd suggest trying to run Visual Studio in elevated mode (Run as Admin). Or use IIS instead of Express, if you can.

0
votes

Did you take look at how to run iisexpress app pool under a different identity

By default iisexpress.exe runs as current logged on user. If the above given link does not work, probably you should launch visual studio as desired user (use 'runas' command) and then automatically iisexpress.exe would run as whatever identity VS is running.