Visual Studio部署项目错误时写入注册表 [英] Visual studio deployment project error when writing to registry

查看:230
本文介绍了Visual Studio部署项目错误时写入注册表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序的设置,最近被转换为一个框架4.0项目(不知道是否相关)。安装程序必须写入注册表(本地机器),直到现在这一直都很完美,但是现在它无法写入干净的机器(运行Windows 7,64位)的注册表。

I have a setup for an application that was recently converted to be a framework 4.0 project (don't know if it's relevant). The setup has to write to registry (Local Machine) and until now this has always worked perfectly, however now it fails to write to registry on a clean machine (running Windows 7, 64 bit).

安装程序不会失败,不会显示任何类型的警告,但是它不会写入注册表(我甚至在每个键中将AlwaysCreate属性设置为true,只是在案例)当然会导致申请在启动时终止。

The setup does not fail, does not show a warning of any kind, however it does not write to the registry (I even set AlwaysCreate property to true on every key, just in case) which of course causes the application to terminate on startup.

可能是什么原因?我从来没有遇到过这样的错误。

What could be the cause of this? I have never encountered such an error before.

编辑:我曾尝试以管理员身份运行安装程序,没有更改任何内容。 p>

I have tried running the installer as administrator, didn't change anything.

推荐答案

正在写入注册表,只是错误的键。 32位安装程序写入HKLM\Software\Wow6432Node,32位程序看到的一组注册表项。您的应用程序将以64位模式运行,不会像这样重定向。

It is writing to the registry okay, just to the wrong key. 32-bit setup programs write to HKLM\Software\Wow6432Node, the set of registry keys that 32-bit programs see. Your app will run in 64-bit mode, it won't get redirected like that.

您需要在安装项目中设置目标平台。或者强制您的应用程序以32位模式运行,并在Build选项卡中使用Target Platform = x86设置。

You'll need to set the target platform in your setup project. Or force your app to run in 32-bit mode with the Target Platform = x86 setting in the Build tab.

这篇关于Visual Studio部署项目错误时写入注册表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆