locked
preview of UserControls not working in a class library | The element "foo" could not be displayed due to missing assemblies RRS feed

  • Question

  • I have a UWP solution with three projects:

    App1 ,ClassLibrary1 and ClassLibrary2

    In the App1 and ClassLibraries are each with a custom UserControl. While it's possible to get a preview (of the UserControls) in the designer of the the App1.Page1, the preview in ClassLibrary1.Page1 is not working.

    I always get the following error message: The element "foo" could not be displayed due to missing assemblies

    https://i.imgur.com/JuInWnu.png

    https://i.imgur.com/iEA3yBQ.png

    ErrorMessage:

    https://i.imgur.com/XlFF4rb.png

    Solution file:

    files.dominic-jonas.de/stackoverflow/App1.zip

    The following steps I tried so far (without success):

    • clean solution
    • rebuild project
    • deleted cache
    • dotnet clean
    • dotnet restore
    • restarted windows
    • updated VisualStudio (v16.6.0) and tried v16.7.0 preview 1

    Anyone know how I can get the preview fixed?

    As my account is not verified, I cannot post the images..

    Thanks!

    • Moved by CoolDadTx Thursday, June 4, 2020 1:13 PM UWA related
    Thursday, June 4, 2020 6:40 AM

All replies

  • Hi D.Jonas,

    Thank you for posting here.

    Since this thread is related to UWP, so I suggest that you can ask this question in Microsoft Q&A for better support.

    The Visual C# forum discusses and asks questions about the C# programming language, IDE, libraries, samples, and tools.

    Best Regards,

    Timon


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Thursday, June 4, 2020 9:26 AM
  • Hey Timon,

    thanks for your reply. For completeness, here are the links to the same question on Microsoft Q&A and Stackoverflow:

    - https://docs.microsoft.com/en-us/answers/questions/33146/preview-of-usercontrols-not-working-in-a-class-lib.html
    - https://stackoverflow.com/questions/62042158/visualstudio-uwp-xaml-designer-not-showing-usercontrol-the-element-foo-could/62240894

    Best Regards,

    Dominic



    • Edited by D.Jonas Monday, June 8, 2020 6:28 AM
    Monday, June 8, 2020 6:26 AM