locked
JS Foreground App with C# background task and C++ dll wont deploy

    Question

  • Hi,

    I have a solution that contains a JS/HTML Metro foreground project, a C# BackgroundTask project and C++ WinRT Component DLL project.

    Everything builds but I can't get it to deploy. The following deployment error is given:-

    Error    12    Cannot install package xxx.group.xx.demo because this package depends on another package which could not be found.             This package requires minimum version 11.0.0.0 of framework microsoft.vclibs.110.debug published by  to install.             Add the framework in order to install the package that depends on the framework    

    The solution built and deployed no problem until I added the C++ project. What am I missing?

    Many thanks

    Mike


    • Edited by MikeHowey Friday, October 21, 2011 4:11 PM
    Friday, October 21, 2011 3:59 PM

Answers

  • Mike: I am unable to reproduce the deployment error you mentioned earlier.  However, I am getting an activation failure for the C++ component at runtime.  It says something to the effect if "This is not a valid Win32 binary".  I have usually seen this when a 64-bit process tries to load a 32-bit binary.  I think the overall solutions settings are getting messed up because you add a arch-independent (C#) and a arch-dependent (C++) component to an arch-independent app (JS).  I will look further into it.
    Sunday, October 23, 2011 8:11 PM
  • Exact mechanincs of how that would happen on the end user's machine would be disclosed later.  But for a developer, the experience from within Visual Studio would be to build different arhictecture packages for one application if it uses native code.
    • Marked as answer by MikeHowey Wednesday, October 26, 2011 10:18 AM
    Tuesday, October 25, 2011 3:59 PM

All replies

  • Hi Mike,

    Can you share more information about the project?  Are you trying to run on the same machine as you built it?  Would you be able to share your solution (or a simple repro scenario) with us to diagnose?

    Thanks
    Raman

    Friday, October 21, 2011 9:37 PM
  • Hi Raman,

    It's easy to reproduce and the problem seems to surface when a solution contains both a C# class library and a C++ WinRT dll. To reproduce:-

     

    1. Create a Metro JS application

    2. Add a WinRT Component DLL. (At this point everything works, and you can call the dll from js no problem)

    3. Add a C# Class library (to make a background task for example)

     

    The application will now not deploy because of the error mentioned. You can download my test solution here.

    Thanks

    Mike

    Saturday, October 22, 2011 8:31 AM
  • Mike: I am unable to reproduce the deployment error you mentioned earlier.  However, I am getting an activation failure for the C++ component at runtime.  It says something to the effect if "This is not a valid Win32 binary".  I have usually seen this when a 64-bit process tries to load a 32-bit binary.  I think the overall solutions settings are getting messed up because you add a arch-independent (C#) and a arch-dependent (C++) component to an arch-independent app (JS).  I will look further into it.
    Sunday, October 23, 2011 8:11 PM
  • Well done Raman, looks like you got it in one! I changed the dll architecture to x64 and it all works so thanks for that.

    It does leave a distribution question though. Presumably we would need to build the dll for the four possible architectures and then include all four in our app package. We would then need to use late binding in the js app to bind to the appropriate dll for the users platform? Is there an example of doing this or am I barking up the wrong tree?

    Mike

    Monday, October 24, 2011 2:34 PM
  • Actually you will need to create a different package for every architecture if you have even a single native component inside your app package.

    So to summarize:

    • Singe package for pure managed apps
    • Single package for pure JScript apps
    • Single package for hybrid JScript+managed apps
    • Multiple packages (one per architecture) for pure native apps
    • Multiple packages (one per architecture) for hybrid JScript+native apps
    • Multiple packages (one per architecture) for hybrid managed+native apps

    Does that help?

    Thanks

    Raman

    Monday, October 24, 2011 5:21 PM
  • So the Window's Store presumably has a mechanism to host multiple packages for the same application built for different architectures and then install the package appropriate to the user's architecture when they choose to install an application?

    Mike

    Tuesday, October 25, 2011 10:48 AM
  • Exact mechanincs of how that would happen on the end user's machine would be disclosed later.  But for a developer, the experience from within Visual Studio would be to build different arhictecture packages for one application if it uses native code.
    • Marked as answer by MikeHowey Wednesday, October 26, 2011 10:18 AM
    Tuesday, October 25, 2011 3:59 PM
  • Understood, and thanks very much for all of this info Raman. Mike
    Wednesday, October 26, 2011 10:19 AM