【问题标题】:"Incompatible platform error" building MSI“不兼容的平台错误”构建 MSI
【发布时间】:2019-09-13 13:58:39
【问题描述】:

我有一个 Windows 服务应用程序,并且正在尝试将 MSI 项目添加到解决方案中。应用程序使用 64 位 Oracle 数据访问 DLL,并构建为 64 位应用程序。

我在解决方案中添加了新的“项目设置”项目并完成了这些步骤。应用项目中还有另外两个 DLL:log4net.dll 和 System.Net.Http.dll。

Windows 服务本身运行良好。当我尝试构建解决方案时,我收到File 'Oracle.DataAccess.dll' targeting 'AMD64' is not compatible with the project's target platform 'x86' 错误。我检查了这个错误,每篇文章都说将安装程序的taget平台设置为x64,这是有道理的。唯一的问题是当我打开安装程序项目的属性窗口时,没有选择目标平台的选项,它是空白的。

这是安装程序“应用程序文件夹”部分的屏幕截图:

这是安装程序属性:

这是 Windows 服务应用程序的属性:

【问题讨论】:

    标签: c# windows-services windows-installer .net-4.5


    【解决方案1】:

    过程:您需要在设置项目的属性窗口中设置 MSI 架构。这是与您显示的不同的属性页。

    1. 左键单击Visual Studio Solution内的Visual Studio Installer Project
    2. F4进入项目的属性页面。
    3. TargetPlatform中选择x64

    提示:尝试在谷歌上搜索遇到此类问题时收到的确切错误消息。这是以前的答案:Can't set 64 bit target for Setup Project in Visual Studio 2017(我添加了一个新答案以获取屏幕截图)。

    提示:以及有关使用 Visual Studio 安装程序项目的提示。它们有很多限制:Visual Studio Publish Project Into One Simple Installer

    MSI 工具:这是quick overview of other MSI tools。还有here is a detailed overview / review


    链接

    【讨论】:

    • 谢谢。在以后的搜索中,我会尽量做到更精确。
    • 不用担心,它往往会有所帮助。以为我会提到它。请略读 VS Installer 项目限制的答案?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-02-22
    • 2019-02-21
    • 2021-01-07
    • 2015-12-19
    • 1970-01-01
    • 2017-05-09
    • 1970-01-01
    相关资源
    最近更新 更多