简体   繁体   English

需要管理员组中的DefaultAppPool才能运行vb脚本

[英]Need DefaultAppPool in the administrators group to run vb script

I'm trying to run a VB script from C# code accessed through a web page. 我正在尝试从通过网页访问的C#代码运行VB脚本。 The web site is using impersonation and is running in an app pool that's using the AppPoolIdentity option. 该网站正在使用模拟,并且正在使用AppPoolIdentity选项的应用程序池中运行。 I'm getting the error regarding 'Loading settings failed', which I've seen other posts and web searches say is related to registry access and certain script host keys missing. 我收到有关“加载设置失败”的错误,我看到其他帖子和网络搜索说与注册表访问和某些脚本主机密钥丢失有关。 I've been through all of that and haven't got it to work. 我已经完成了所有这些并且没有得到它的工作。 I've added the keys, set permission on the hives and such. 我已经添加了密钥,设置了荨麻疹的权限等。

The only thing I have been able to do to get it working is either adding the DefaultAppPool service account to the administrators group or otherwise making the app pool use an administrator account. 我唯一能做到的就是将DefaultAppPool服务帐户添加到管理员组,或者使应用程序池使用管理员帐户。 This is likely not an acceptable solution for a production web site. 对于生产网站而言,这可能不是可接受的解决方案。

I've used process monitor to attempt to find the problem and I don't see it. 我已经使用过程监视器来尝试找到问题而我没有看到它。 I can see the w3wp app call cscript but I don't see any access denied or other errors. 我可以看到w3wp应用程序调用cscript但我没有看到任何访问被拒绝或其他错误。

I'm looking for some hints on how I might narrow this down to the resource that is causing the problem. 我正在寻找一些关于如何将其缩小到导致问题的资源的提示。 I'm running this on my dev machine at the moment, its Win 7 64 bit, IIS 7.5, the app is in ASP.Net 2.0. 我现在在我的开发机器上运行它,它的Win 7 64位,IIS 7.5,应用程序在ASP.Net 2.0中。

Firstly please don't make anything an administrator account. 首先请不要将任何东西设为管理员帐户。 It'd be useless anyway as you say you're using impersonation - so the app pool identity will hardly be used. 无论如何,当你说你正在使用模仿时,它将毫无用处 - 因此很难使用应用程序池标识。

What is the VBScript file trying to do? 什么是VBScript文件试图做什么? Given VBScript isn't that difficult and if it tries to do anything complicated it's going to call COM it shouldn't be that difficult to move it into a C# class and have it run in the correct context of your application (and that way you'll get better error messages if you're lucky) 鉴于VBScript并不那么困难,如果它试图做任何复杂的事情,它会调用COM,将它移动到C#类并让它在你的应用程序的正确上下文中运行应该不那么困难(那样你如果你很幸运,我会得到更好的错误信息)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM