如何在不同身份下运行iisexpress应用程序池
有没有办法以当前登录用户以外的不同身份运行 iisexpress 应用程序池?
我目前正在使用“runas”命令解决这个问题,但我想知道 iisexpress 是否有内置的东西可以利用。
is there a way to run iisexpress app pool under a different identity other than the currently logged in user?
I am getting around this problem using the "runas" command currently but I would like to know if there is something built-in to iisexpress that I can utilize.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
看起来这应该是可能的。在 IIS Express 站点的 applicationhost.config 文件中,在
下定义了一个
元素。userName
和password
属性。来自 MSDN:
这应该允许您使用与登录用户不同的凭据运行该站点。
It looks like this should be possible. In your IIS Express site's applicationhost.config file, there is a
<processModel/>
element defined in<applicationPoolDefaults>
under<applicationPools>
The
<processModel>
element has attributes foruserName
andpassword
.From MSDN:
This should allow you to run the site under different credentials from the logged in user.
我无法使上述解决方案发挥作用,并且我希望能够通过 Visual Studio 进行调试,同时在不同的凭据下运行 IIS Express。
现在,您可以在作为凭据运行的 IISExpress 下正常调试(假设这是您配置项目的方式)。如果您需要对数据库连接或类似的东西使用集成安全性,但需要使用不同的凭据,那么这非常有用。
I could not get the above solution to work and I wanted to be able to debug through Visual Studio while running IIS Express under different credentials.
You can now debug as normal under IISExpress (assuming this is how you have your project configured) under the run as credentials. This is great if you need to use integrated security for database connections or something similar but need to use different credentials.
“runas”只是解决方案。 IIS Express 可能不尊重 applicationhost.config 文件中定义的 processModel 设置。
"runas" is only the solution. IIS Express maynot respect processModel settings which are defined in applicationhost.config file.
从命令行运行 /netonly IISExpress.exe 确实可以工作,并且如果您像我们一样迫切需要答案,则非常可行。 相关帖子
Runas /netonly IISExpress.exe from command line does work and is very viable if you're as desperate for an answer as we were. Related post
我想知道这是否真的有效 - IIS Express 似乎在同一进程中运行所有应用程序池 - 并且该进程是在当前用户的上下文中执行的......?
似乎“运行方式”选项可以工作,但这需要我们从命令行(或构建事件)启动 IIS Express,而不是依赖 Visual Studio 启动它。 :(
I wonder if this really works - IIS Express seems to run all application pools in the same process - and that process is executed in the context of the current user...?
Seems the "Run as" option could work, but that would require us to launch IIS Express from the command line (or build event) instead of relying on Visual Studio starting it up. :(