MSBuild失败。缺失发布/ WinRTXamlToolkit
试图与msbuild
建立Windows 8.1
商店应用程序,但出现错误。这是我与msbuild
的第一次战斗,我对文档没有太多的好运,因为它似乎都利用了UWP
特定的事情。我得到的错误读取MSBuild失败。缺失发布/ WinRTXamlToolkit
C:\ git的\ ADR \ win8app的\ src \ AppDataRoom.WinRT.Adr \ AppDataRoom.WinRT.Adr.csproj”(默认目标)(1) - > (_GenerateAppxPackageRecipeFile目标) - > C:\ Program Files文件(x86)\ MSBuild \ Microsoft \ VisualStudio \ v14.0 \ AppxPackage \ Microsoft.AppXPackage.Targets(2156,5):错误 APPX0702:有效内容文件'C:\ app \ bin \ 64 \发布\ WinRTXamlToolkit \ WinRTXamlToolkit.xr.xml”不 上课不存在的。
有以下所有其他25个错误有关WinRTXamlToolkit
的的内心缺少什么夹
我msbuild
命令我运行是:
msbuild .\app.csproj /p:Configuration="Release" /p:Platform="x64
我明白WinRTXamlToolKit
是nuget
包,我可以看到发布文件夹内的dll,但我做的怎么样如何解决这个错误?我错过了什么?
我最终找到了一个解决方案(虽然它仍然感觉有点哈克)。我最终将所有内容都包装在一个PowerShell脚本中。该脚本首先恢复项目nuget包,以防万一由于某种原因不在那里。然后脚本将WinRTXamlToolKit文件夹从软件包复制到bin/x64/Release文件夹中,然后运行MSBuild命令,现在一切正常。这里是脚本是什么样子(我就不写了PowerShell脚本非常频繁,所以我的约定可能不是最好的)
#create some alias
$nugetPath = $sourceControlRoot + ".nuget/nuget.exe";
$nugetPackagesPath = $sourceControlRoot + "/packages/";
$projectPath = $sourceControlRoot + "/TestingProject/"
Set-Alias nuget $nugetPath
#Nuget Restore
$solutionPath = $sourceControlRoot + "/TestingProject.sln"
nuget restore $solutionPath
#To Help MSBuild we need to copy the WinRTXamlToolkit into the bin/Release folders
$winRtXamlToolkitPath = $nugetPackagesPath + "WinRTXamlToolkit.1.6.1.3/lib/netcore451/WinRTXamlToolkit"
$copyOutput64 = $projectPath + "bin/x64/Release/WinRTXamlToolkit"
$copyOutput86 = $projectPath + "bin/x86/Release/WinRTXamlToolkit"
$testPath = $copyOutput64
if (!(Test-Path $testPath)) {
Copy-Item $winRtXamlToolkitPath $copyOutput64 -recurse
Copy-Item $winRtXamlToolkitPath $copyOutput86 -recurse
Write-Output "WinRTXamlToolkit copied into bin folders"
}
#build the project
$buildPath = $projectPath + "TestingProject.csproj"
msbuild $buildPath /p:Configuration="Release" /p:Platform="x64"
更新:如果我复制我的根目录下,从“/包”文件夹中的文件夹WinRTXamlToolkit进入“bin/x64/Release”构建成功,但有没有办法指向文件夹而不必复制它? –
“WinRTXamlToolKit”包的版本是什么?由于您正在构建Windows 8.1商店应用程序,因此您应该使用版本1.6.1.3。我创建了一个Windows 8.1商店应用程序,在版本1.6.1.3中添加'WinRTXamlToolKit'包,然后使用MSBuild命令行构建它,它工作正常。如果您使用的是该版本软件包,请分享一些详细步骤,以便我可以重现此问题吗? –