如何在 Windows 10 中设置Visual Studio 2017添加或删除“以管理员身份运行”

在使用Visual Studio 2017进行二次开发时遇到权限问题,导致`Marshal.GetActiveObject`失败。通过不以管理员权限运行VS2017和中望CAD可以解决。详细步骤包括打开注册表,修改AppCompatFlagsLayers下的设置,添加字符串值并设置数值以控制VS2017的运行模式。
摘要由CSDN通过智能技术生成

最近在使用Visual Studio 2017对中望CAD进行二次开发时,当使用"Marshal.GetActiveObject"函数连接对象时,总是提示下图中的报错:

Google了一下发现了一个帖子中提到:

If you have UAC on, and your application requests administrator privilege to run, then it can not access the registry of HKEY_CURRENT_USER, and Inventor has some registry values in HKEY_CURRENT_USER for the CreateInstance to work, so your application would fail in this case, and if you run it as standard user privilege it would work. So I suggest in this case you just run your application in standard user privilege.

帖子链接:

  • 2
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值