我打电话给: config.Save(ConfigurationSaveMode.Modified); 这个调用在Windows XP中运行良好。

当我在Vista中运行时,我得到:

  

异常:System.Reflection.TargetInvocationException:调用目标抛出了异常。 ---> System.Configuration.ConfigurationErrorsException:加载配置文件时发生错误:拒绝访问路径“C:\ Windows \ system32 \ 2lqfj0cv.tmp”。 (C:\ Windows \ system32 \ MsiExec.config)---> System.UnauthorizedAccessException:拒绝访问路径'C:\ Windows \ system32 \ 2lqfj0cv.tmp'。

现在我说这里的相关事实是我正在从Windows Installer MSI(调用托管DLL)运行上面的调用。我想我需要做一些事情来提升用户权限?我真的不太了解Vista的权限吗?

有帮助吗?

解决方案

尝试使用run as admin。你的意思是编辑MSIEXEC.config吗?

http://msdn.microsoft.com/en-us/library /bb756929.aspx

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top