我正在尝试安装最近发布的 WiX Toolset v4 但没有任何运气。
根据文档,“wix.exe 工具需要 .NET SDK,版本 6 或更高版本。”我安装了 .NET SDK 7.0 via winget 并运行安装 WiX 的命令只收到以下错误:
C:\Program Files\dotnet>dotnet.exe tool install --global wix --version 4.0.0
C:\...\restore.csproj : error NU1100: Unable to resolve 'wix (>= 4.0.0)' for 'net7.0'.
C:\...\restore.csproj : error NU1100: Unable to resolve 'wix (>= 4.0.0)' for 'net7.0/any'.
The tool package could not be restored.
Tool 'wix' failed to install. This failure may have been caused by:
* You are attempting to install a preview release and did not use the --version option to specify the version.
* A package by this name was found, but it was not a .NET tool.
* The required NuGet feed cannot be accessed, perhaps because of an Internet connection problem.
* You mistyped the name of the tool.
For more reasons, including package naming enforcement, visit https://aka.ms/failure-installing-tool
我删除了 .NET SDK v7,安装了 v6,再次尝试安装 WiX,得到了类似的结果。还尝试删除
--version
以查看它是否会安装任何版本的 WiX 工具集,但没有这样的运气:
C:\...\restore.csproj : error NU1100: Unable to resolve 'wix (>= 0.0.0)' for 'net6.0'.
C:\...\restore.csproj : error NU1100: Unable to resolve 'wix (>= 0.0.0)' for 'net6.0/any'.
有人知道我在这里做错了什么或遗漏了什么吗?安装语句看起来相当简单,但错误(以及随附的 error 文档)并没有太大帮助(无论如何对我来说)。
dotnet nuget list source
是否列出https://api.nuget.org/v3/index.json
? WiX 工具 NuGet 包位于 nuget.org 上,因此您必须在源列表中包含 NuGet.org 提要。
你也可以跑步
dotnet tool install --verbosity detailed --global wix --version 4.0.0
获取有关尝试的更多详细信息。它还包括一个提要列表:
Feeds used:
https://api.nuget.org/v3/index.json