Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Xaml UserControl in plugin throwing exceptions for Windows 10 UWP build

Discussion in 'Windows' started by kshitijgandhi, Dec 10, 2015.

  1. kshitijgandhi


    Jul 13, 2015
    We have a plugin for our game which shows a WebBrowser as a UserControl.

    In case of Windows Phone 8 & Windows Universal 10 platform we have class libraries in the form of dll files.

    For Windows Universal 10 platform, the library throws a XamlParseException.

    According to ZeeMoussa's answer (and comments) on following thread I posted on StackOverflow -

    XamlParseException when using UserControl from class library dll

    there are xbf files generated in the build process for Xaml user controls.
    From what I know, this was now the case with WP8 and everything worked fine - I could easily show a UserControl from the dll in the game.
    I could include these xbf files automatically in a test visual studio solution by adding a reference to the UserControl project in the solution.

    But when I did the same with the Visual Studio project that was generated with Unity, I got some errors -
    a) if I didn't remove the reference to dll in the project (I had to include the dll in the Plugins folder in Unity project to build it), then there were duplicate dll files and the project didn't compile
    b) and if I removed the references to the dll, the the project would compile but give a runtime exception - related to Unity not finding the referenced dll files.

    I'm not sure how to include the xbf files in the unity game or how to reference project in the Visual Studio solution so as to not get any errors.

    All help is greatly appreciated!
  2. Aurimas-Cernius


    Unity Technologies

    Jul 31, 2013
    Does that plugin have any MonoBehaviour classes? You may try to mark this plugin as don't process then.
  3. Tautvydas-Zilys


    Unity Technologies

    Jul 25, 2013
    You could also add those xbf files to the generated VS project manually.