具有有限权限的动态加载程序集
我正在尝试收集有关以下主题的一些信息: 我开发了一个需要管理员权限的应用程序。这是通过清单文件中的以下行实现的:
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
现在我想做的是提供一个简单的界面供人们使用并为此应用程序创建扩展。这应该作为程序集提供,并将放置在“插件”目录中。应用程序将动态加载它们。
显然,我不希望以管理员权限加载这些程序集。
有哪些推荐的方法可以做到这一点?
谢谢!
I am trying to gather some information on the following subject:
I have developed an application that requires administrator rights. This is achieved with the following line in the manifest file:
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
Now what I would like to do is to provide a simple interface for people to use and create an extension for this application. This should be provided as an assembly an will be placed in the 'Plugins' directory. The appplication will load them in dynamicly.
Obviously, I would not want those assemblies to be loaded with administrator rights.
What are the recommended ways to do this?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不太确定您要做什么,但是如果您想加载具有有限权限的程序集,请创建一个新的应用程序域并通过提供一些低权限级别的证据来为其分配有限的权限,例如将其放在互联网上区。然后将您的程序集加载到该域中,它将具有这些低权限。
这里类似的内容可以帮助您入门。
这里更多关于证据。
I'm not quite sure what you are trying to do, but if you want to load an assembly with limited rights, create a new application domain and assign it limited permissions by providing some low-permission level evidence, like putting it in the internet zone. Then load your assembly into this domain and it will have those low permissions.
Here's something similar to get you started.
Here's more about evidence.