【问题标题】:How to avoid necessity of Admin. privileges for Visual Studio with IIS or COM Interop?如何避免管理员的必要性。具有 IIS 或 COM 互操作的 Visual Studio 的权限?
【发布时间】:2012-05-17 17:04:42
【问题描述】:

当 Visual Studio 在没有管理员的情况下运行时。特权和

我正在为 COM 互操作注册 .dll,错误消息是:

Cannot register assembly "myassembly.dll" - access denied. 
Please make sure you're running the application as administrator. 
Access to the registry key 'HKEY_CLASSES_ROOT\' is denied.

我在 IIS 上运行 Web 应用程序,错误消息是:

The Web Application Project PSW is configured to use IIS. 
To access local IIS Web sites, you must run Visual Studio 
in the context of an administrator account.

我已将 Visual Studio 设置为管理员运行以避免这些错误。但是 UAC 消息让我很烦(但我不想关闭 UAC)。
有没有办法正常运行 Visual Studio 并使用 COM Interop 或 IIS?我的意思是例如对注册表或 IIS 的一些访问权限或将 regasm 设置为以管理员身份运行。

【问题讨论】:

    标签: visual-studio iis windows-7 com-interop uac


    【解决方案1】:

    UAC 要求应用程序将自身拆分为标准的用户友好部分和仅限管理员的部分,然后您只能在需要仅限管理员的部分时请求提升(动态提升)。

    但是,当前的 Visual Studio 版本,2008 年、2010 年,甚至 11 Beta 仍然是单片的(就像一个单片内核,http://en.wikipedia.org/wiki/Monolithic_kernel)。所以现在不可能达到你想要的,你必须习惯它。

    对注册表或 IIS 的某些访问权限无济于事,因为您显然对 Visual Studio 的考虑太少了 :) 它是一个更大的系统,依赖于太多的底层位。

    【讨论】:

    • 你的意思是在VS启动后甚至不能要求提升(按项目类型?)
    • 你必须在开始 VS 之前决定是否提升。在 VS 2010 或 11 中,IDE 有时可能会告诉您智能地使用海拔重新启动,但这仍然不是即时海拔。
    猜你喜欢
    • 1970-01-01
    • 2011-02-07
    • 1970-01-01
    • 1970-01-01
    • 2014-05-28
    • 2016-06-17
    • 2018-05-10
    • 1970-01-01
    • 2011-12-25
    相关资源
    最近更新 更多