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

最近在使用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.

帖子链接: