Microsoft-ui-xaml: Building a Nuget packet for this repo

Created on 30 Sep 2019  ·  3Comments  ·  Source: microsoft/microsoft-ui-xaml

Hi, I have forked this repo and trying out some changes of my own.
How do I create a nuget package for this repo so that I can test it locally?
The documentation does not provide any detail.

It would be great if you could update the documentation for the same.

area-DevInternal documentation help wanted team-Controls

All 3 comments

We should update our documentation. In the meantime, generally we do this:

Build the flavors of the project in VS that you want, testing with MUXControlsTestApp and then when it looks good create a nuget package for that flavor using build-nupkg.ps1 (Passing in the BuildFlavor/BuildArch parameters for whichever flavor you just built). Then the downstream test app has to be built in that same buildarch.

@jevansaks I followed the steps you mentioned and built the debug x64 version of Microsoft.UI.Xaml and then executed the build-nupkg.ps1 script to build the nuget package.

Now when I add this nuget package to my own app and build it, I get the following errors


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          

It seems that the folders DensityStyles and Themes are not present in runtimes\win10-x64\native\Microsoft.UI.Xaml folder of the nuget package.

So, I unzipped the nuget package and manually copied these two folders and their contents (from BuildOutput\Debug\x64\Microsoft.UI.Xaml). Then I zipped it again and renamed it to .nupkg.
Then it worked properly.

Is there anything missing in the build-nupkg.ps1 script due to which the two folders are not being copied?

Oh I remember now, there's a new-ish VS optimization for F5 times in debug builds which makes it so that the .pri files from debug builds won't work for nuget packages by default. You can either build release and use that or change this setting in the vcxproj to be false for debug too:

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

Was this page helpful?
0 / 5 - 0 ratings