The following forum(s) have migrated to Microsoft Q&A (Preview): Developing Universal Windows apps!
Visit Microsoft Q&A (Preview) to post new questions.

Learn More

[UWP] [Desktop Bridge] Embedding DLLs in Appx package RRS feed

  • Question

  • Are there any limitations on what kind of libraries (DLL) can be embedded as part of Appx package when authoring Appx package for UWP Desktop Application ? 

    My application which I want to "wrap" with Appx package uses some DLLs. I enclosed these DLLs as part of the solution - as "content", with  "copy always" option. Some of these DLLs are built by my solution, other are 3rd party ones. My DLLs can be packaged into the Appx bundle. Some of the 3rd party DLLs however can't

    When I build the Packaging project I get the following error (always about not being able to serialize baml [i guess being part of these 3rd party DLLs)) 

    "Error MSB4018 The "GenerateResource" task failed unexpectedly. System.InvalidOperationException: Item named 'themes/generic/vectorlayer.baml' of type 'System.IO.UnmanagedMemoryStream' cannot be added to the resource file because it is not serializable."

    For example: DevExpress.Xpf.Map.v11.2.dll, WPFToolkit.dll - I can't figure out how to enclose these two as part of appx package... (getting the above serialization error during build). But still need these in the final application 

    Update: it seems that my problem is narrowed down to WPF DLLs with BAML (precompiled XAML) embedded in these DLLs. Any ideas how to enclose such DLL as part of Appx package ?  
    • Edited by Michal.Jan Thursday, August 31, 2017 7:19 PM more info
    Thursday, August 31, 2017 3:03 PM

All replies

  • Hello,

    Can you explain why you embed these dll's as content? 

    Make the community better together

    Friday, September 1, 2017 5:05 AM
  • Hi, 

    the reason for which I embed these files as "content" is that this is the way described in MSDN tutorial  (found here:

    Otherwise, when "Package Action" is not "Content", the DLLs are not enclosed in the final package.



    Saturday, September 2, 2017 9:59 AM
  • try to package manually 

    Make the community better together

    • Proposed as answer by Breeze Liu Wednesday, September 13, 2017 9:30 AM
    Saturday, September 2, 2017 12:25 PM