Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[0.8 Preview] Building class library with XAML controls in Release config fails #923

Closed
andrewleader opened this issue Jun 10, 2021 · 2 comments
Assignees
Labels
area-Infrastructure Build, test, source layout, package construction (TODO: move to Deployment, DeveloperTools) bug Something isn't working
Milestone

Comments

@andrewleader
Copy link
Contributor

andrewleader commented Jun 10, 2021

Describe the bug
This is a known issue that affects the 0.8 Preview. If you have a WinUI 3 class library that defines XAML controls and are using the 0.8 Preview, attempting to build your app in Release config will fail with the error seen below. The stable 0.5 release is not affected by this issue.

Error    MSB3030
Could not copy the file
"C:\Users\aleader\source\repos\App24Experimental\ClassLibrary1\bin\x86\Release\net5.0-windows10.0.19041.0\UserControl1.xbf"
because it was not found.     ClassLibrary1 C:\Users\aleader\.nuget\packages\microsoft.projectreunion.foundation\0.8.0-preview\build\Microsoft.ApplicationModel.Resources.PriGen.targets

Workaround
Add <GenerateLibraryLayout>true</GenerateLibraryLayout> to your class library.

We've fixed this with pull request #917 but there is not yet a new version available with this fix.

Steps to reproduce the bug

  1. Create a 0.8 Preview WinUI 3 desktop app
  2. Add a 0.8 Preview WinUI 3 class library
  3. Add a new UserControl (which uses a XAML page)
  4. Reference the class library from the desktop app
  5. In your desktop app, use the UserControl you defined
  6. Attempt to build the app in Release config

Expected behavior
App should build successfully.

Version Info

NuGet package version:
0.8.0-preview

@andrewleader andrewleader added bug Something isn't working area-Infrastructure Build, test, source layout, package construction (TODO: move to Deployment, DeveloperTools) labels Jun 10, 2021
@andrewleader andrewleader added this to the 0.8 (2021 Q2) milestone Jun 10, 2021
@andrewleader
Copy link
Contributor Author

Closing as this has been fixed with pull request #917, but note that no release with the fix is available yet.

@huichen123
Copy link
Contributor

huichen123 commented Jun 10, 2021

a possible workaround is to add <GenerateLibraryLayout>true</GenerateLibraryLayout> in csproj.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Infrastructure Build, test, source layout, package construction (TODO: move to Deployment, DeveloperTools) bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants