locked
Navigation to external library view works only when adding project reference, not dll

    Question

  • I have a windows universal app and I want to reference a view in a seperate project. If I add the project to my solution, and then add the reference to that project in my app, I can navigate to the view no problem.

    If instead I build the separate project and reference the DLL for that project, I can still navigate to the view but when I do I get the exception: “XAML parsing failed”.

    Why would it work if I add the project reference, but not the dll? Is there any way to make it work via dll (my goal is to be able to distribute the separate project via nuget)

    Friday, April 24, 2015 11:27 PM

All replies

  • It doesn't work because the XAML page isn't embedded in the DLL.  There's not a way to embed the XAML in a Windows Store project, but I think you could include the XAML page directly in your project, along with the DLL, as long as the namespace is correct.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Saturday, April 25, 2015 12:23 PM
    Moderator
  • thank you for your reply but I'm still confused. I'm not attempting to embed the xaml into the dll. it compiles a xbp which I'm expecting to be able to distribute alongside the dll...

    but it only works if I reference the project directly, not if I reference the dll. I'm curious what the solution is doing differently between these two options.

    I'll try and record a video of the problem maybe that will help. thanks again

    Wednesday, May 6, 2015 3:36 PM