WiX 非常新,但有一个我无法解决的问题。我有一个简单的控制台应用程序,我有一个简单的 Wix 安装程序。我已按照基本指南安装我的控制台应用程序。该软件似乎已正确安装,但缺少我已包含在控制台应用程序中的库。
我得到的错误是:
Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'FluentCommandLineParser, Version=1.4.3.0, Culture=neutral, PublicKeyToken
=null' or one of its dependencies. The system cannot find the file specified.
Run Code Online (Sandbox Code Playgroud)
这个“FluentCommandLineParser”只是我使用的一个库,我使用 Nuget 包管理器安装到项目中。
我是否必须引用控制台应用程序正在使用的每个单独的库?如果是这样,我该怎么做?
我试图通过从项目 debug/bin 文件夹中添加 FluentCommandLineParser.dll 作为 WiX 安装程序项目中的引用来解决,但它会在构建时吐出。
如果您希望将 FluentCommandLineParser.dll 作为组件添加到安装程序中,则需要将其添加到安装程序中。
由于您使用 nuget 添加了它,因此它可能被添加为“Copy Local = True”的参考,因此您可以轻松地将其添加到您的安装中。
只需添加一个新组件
<Component Id="FluentCommandLineParser.dll" Guid="*">
<File Id="FluentCommandLineParser.dll" KeyPath="yes" Source="$(var.ProjectNameHere.TargetDir)FluentCommandLineParser.dll" />
</Component>
Run Code Online (Sandbox Code Playgroud)
这应该将 dll 添加到您的安装程序中。
这是一个解释和定义与项目引用相关的所有可用预处理器变量的链接。
| 归档时间: |
|
| 查看次数: |
1852 次 |
| 最近记录: |