Microsoft-ui-xaml: 为这个 repo 构建一个 Nuget 数据包

创建于 2019-09-30  ·  3评论  ·  资料来源: microsoft/microsoft-ui-xaml

嗨,我已经分叉了这个 repo 并尝试了我自己的一些更改。
如何为这个 repo 创建一个 nuget 包,以便我可以在本地测试它?
文档没有提供任何细节。

如果您可以更新相同的文档,那就太好了。

area-DevInternal documentation help wanted team-Controls

所有3条评论

我们应该更新我们的文档。 与此同时,我们通常这样做:

在 VS 中构建您想要的项目风格,使用 MUXControlsTestApp 进行测试,然后当它看起来不错时,使用 build-nupkg.ps1 为该风格创建一个 nuget 包(为您刚刚构建的任何风格传递 BuildFlavor/BuildArch 参数)。 然后下游测试应用程序必须在同一个 buildarch 中构建。

@jevansaks我按照你提到的步骤构建了 Microsoft.UI.Xaml 的调试 x64 版本,然后执行build-nupkg.ps1脚本来构建 nuget 包。

现在,当我将此 nuget 包添加到我自己的应用程序并构建它时,出现以下错误


Payload file 'C:\Users\user\.nuget\packages\microsoft.ui.xaml\2.3.0.28\runtimes\win10-x64\native\Microsoft.UI.Xaml\Themes\rs3_compact_themeresources.xbf' does not exist.   TestXamlUI          
Payload file 'C:\Users\user\.nuget\packages\microsoft.ui.xaml\2.3.0.28\runtimes\win10-x64\native\Microsoft.UI.Xaml\Themes\rs4_generic.xbf' does not exist.  TestXamlUI          
Payload file 'C:\Users\user\.nuget\packages\microsoft.ui.xaml\2.3.0.28\runtimes\win10-x64\native\Microsoft.UI.Xaml\Themes\19h1_themeresources.xbf' does not exist.  TestXamlUI          
Payload file 'C:\Users\user\.nuget\packages\microsoft.ui.xaml\2.3.0.28\runtimes\win10-x64\native\Microsoft.UI.Xaml\Themes\rs4_compact_themeresources.xbf' does not exist.   TestXamlUI          
Payload file 'C:\Users\user\.nuget\packages\microsoft.ui.xaml\2.3.0.28\runtimes\win10-x64\native\Microsoft.UI.Xaml\DensityStyles\Compact.xbf' does not exist.   TestXamlUI          
Payload file 'C:\Users\user\.nuget\packages\microsoft.ui.xaml\2.3.0.28\runtimes\win10-x64\native\Microsoft.UI.Xaml\Themes\rs2_generic.xbf' does not exist.  TestXamlUI          
Payload file 'C:\Users\user\.nuget\packages\microsoft.ui.xaml\2.3.0.28\runtimes\win10-x64\native\Microsoft.UI.Xaml\Themes\rs3_generic.xbf' does not exist.  TestXamlUI          
Payload file 'C:\Users\user\.nuget\packages\microsoft.ui.xaml\2.3.0.28\runtimes\win10-x64\native\Microsoft.UI.Xaml\Themes\rs2_themeresources.xbf' does not exist.   TestXamlUI          
Payload file 'C:\Users\user\.nuget\packages\microsoft.ui.xaml\2.3.0.28\runtimes\win10-x64\native\Microsoft.UI.Xaml\Themes\rs2_compact_themeresources.xbf' does not exist.   TestXamlUI          
Payload file 'C:\Users\user\.nuget\packages\microsoft.ui.xaml\2.3.0.28\runtimes\win10-x64\native\Microsoft.UI.Xaml\Themes\rs5_compact_themeresources.xbf' does not exist.   TestXamlUI          
Payload file 'C:\Users\user\.nuget\packages\microsoft.ui.xaml\2.3.0.28\runtimes\win10-x64\native\Microsoft.UI.Xaml\DensityStyles\CompactDatePickerTimePickerFlyout.xbf' does not exist. TestXamlUI          
Payload file 'C:\Users\user\.nuget\packages\microsoft.ui.xaml\2.3.0.28\runtimes\win10-x64\native\Microsoft.UI.Xaml\Themes\19h1_generic.xbf' does not exist. TestXamlUI          
Payload file 'C:\Users\user\.nuget\packages\microsoft.ui.xaml\2.3.0.28\runtimes\win10-x64\native\Microsoft.UI.Xaml\Themes\rs4_themeresources.xbf' does not exist.   TestXamlUI          
Payload file 'C:\Users\user\.nuget\packages\microsoft.ui.xaml\2.3.0.28\runtimes\win10-x64\native\Microsoft.UI.Xaml\Themes\rs5_themeresources.xbf' does not exist.   TestXamlUI          
Payload file 'C:\Users\user\.nuget\packages\microsoft.ui.xaml\2.3.0.28\runtimes\win10-x64\native\Microsoft.UI.Xaml\Themes\19h1_compact_themeresources.xbf' does not exist.  TestXamlUI          
Payload file 'C:\Users\user\.nuget\packages\microsoft.ui.xaml\2.3.0.28\runtimes\win10-x64\native\Microsoft.UI.Xaml\Themes\rs5_generic.xbf' does not exist.  TestXamlUI          
Payload file 'C:\Users\user\.nuget\packages\microsoft.ui.xaml\2.3.0.28\runtimes\win10-x64\native\Microsoft.UI.Xaml\Themes\rs3_themeresources.xbf' does not exist.   TestXamlUI          

似乎文件夹DensityStylesThemes不存在于 nuget 包的runtimes\win10-x64\native\Microsoft.UI.Xaml文件夹中。

因此,我解压缩了 nuget 包并手动复制了这两个文件夹及其内容(来自BuildOutput\Debug\x64\Microsoft.UI.Xaml )。 然后我再次压缩它并将其重命名为 .nupkg。
然后它正常工作。

build-nupkg.ps1脚本中是否缺少任何由于未复制两个文件夹而导致的内容?

哦,我现在记得,在调试版本中对 F5 时间有一个新的 VS 优化,这使得调试版本中的 .pri 文件在默认情况下不适用于 nuget 包。 您可以构建发布并使用它,也可以将 vcxproj 中的此设置更改为 false 以进行调试:

https://github.com/microsoft/microsoft-ui-xaml/blob/7d2cd793a0154580f1dd0c9685c461198e05f207/dev/dll/Microsoft.UI.Xaml.vcxproj#L35

此页面是否有帮助?
0 / 5 - 0 等级