1

我有一个 Wix 安装程序项目,需要运行msbuild以生成 .dll 文件和可执行文件,我目前在我的项目中拥有它,如下所示:

<Target Name="BeforeBuild">
    <!-- Publish dotnet core app -->
    <Exec Command="msbuild /p:configuration=release ..\Regulator2App.WPF\Regulator2App.WPF.csproj" />
    ...
</Target>

当我构建安装程序项目时,我收到以下错误:

The attribute "Version" in element <PackageReference> is unrecognized.  Regulator2App.Installer C:\Users\Iván\Desktop\regulator2app\Regulator2App\Regulator2App\Regulator2App.csproj

指向这一行:

<ItemGroup>
   <PackageReference Include="GuerrillaNtp" Version="1.4.1" />
   ...
</ItemGroup>

然后命令以代码 1 退出。

如何将 msbuild 命令添加到我的安装程序?需要添加/更改什么?

我的设置与本教程完全相同。

4

1 回答 1

2

我个人创建一个 Application.sln 和一个 Installer.sln 并构建前者,然后构建后者。我在https://github.com/iswix-llc/iswix-tutorials的教程中谈到了它。

于 2019-08-14T23:30:46.190 回答