locked
How to bundle x32,x64 and ARM dll with a package?

    Question

  • I have the requirement to bundle a 3rd party DLL for each platform with my AppPackage. 

    How do I do that in VS11? The Properties dialog is always crashing "Lost track of Content" when I change the settings for each DLL that I have referenced in my project. I put 3 dlls named:

    foo_x86.dll
    foo_x64.dll
    foo_arm.dll
    "as link" into my metro project and referenced the WinRT project that is using the DLLs.

    Now I wanted to mark each dll's "Content" to "Copy" only in the configuration it supports.

    Any ideas?

    Friday, March 02, 2012 3:43 PM

Answers

  • There may be a better way to accomplish this (I'm looking and I'll let you know if I locate one) but this is the approach that is working for me currently.

    I have a single 'drop' point for my referenced WinRT component, which is where my project reference for the WinRT component Full Path is set. In this example my reference is in my consuming project folder. I added a pre build event for each architecture that copies the corresponding DLL into the folder where my project reference was set. Using this method, I only get the correct architecture DLL deployed and packaged.


    David Lamb


    Saturday, March 10, 2012 2:34 AM
    Moderator

All replies

  • One thing you can do here is to specify these thrid party dlls as the output for custom build tools/steps. The output of the custom build tools/steps will be packaged and it will be platform specific.

    You mentioned about "The Properties dialog is always crashing "Lost track of Content" when I change the settings for each DLL that I have referenced in my project". Could you be more specific about the repro steps? You can also contact me at lishao at microsoft dot com if you have more detailed repro.

    Li Shao, MSFT


    Li Shao

    Tuesday, March 06, 2012 9:26 PM
  • Where do I specify custom build steps in the IDE? I see the fields in the project file, but there seems to be no IDE support.

    To reproduce the properties dialog failure follow these steps:

    1. Display the properties of a dll included in the project. 
    2. Select "Package Action" "None"
    3. Press "OK"
    4. Try to display the properties dialog of that dll again
    5. It does not open. You have to close the project/reload it.
    Wednesday, March 07, 2012 9:44 AM
  • If you right click on the project node in the solution explorer and bring up the property page, you will see custom build step. You can take a look of this MSDN link: http://msdn.microsoft.com/en-US/library/hefydhhy(v=vs.80).aspx  Most of the descriptions there still applies to VS2011.

    Thanks for your repro steps. I will follow up.

    Li Shao, MSFT


    Li Shao

    Thursday, March 08, 2012 4:45 AM
  • There may be a better way to accomplish this (I'm looking and I'll let you know if I locate one) but this is the approach that is working for me currently.

    I have a single 'drop' point for my referenced WinRT component, which is where my project reference for the WinRT component Full Path is set. In this example my reference is in my consuming project folder. I added a pre build event for each architecture that copies the corresponding DLL into the folder where my project reference was set. Using this method, I only get the correct architecture DLL deployed and packaged.


    David Lamb


    Saturday, March 10, 2012 2:34 AM
    Moderator
  • So, you're including all of the WinRT component DLL's in the project as an asset in the bin folder.

    How do you add them as a reference to your project?

    I have a C# app (which I had hoped to target Any CPU at the moment) that takes a dependency on a C++ component I wrote?

    I assume I have to build C++ dll's for all three architectures if I want to support all 3, right?

    I assume I can't ship a 32 bit Windows Store App and have it run on 64 bit?

    A good pointer to documentation on how I really ought to do this would be greatly appreciated.


    Anthony Wieser | Wieser Software Ltd | www.wieser-software.com

    Wednesday, November 21, 2012 10:58 PM
  • This was a little tricky to sort out but I used varient of combined suggestions and found a workabe solution.

    Assuming you have the following 3 projects in your solution: Proj1 (Proj1.dll), Proj2(Proj2.dll), and MainApp.exe

    For both Proj1 and Proj2 have the output directed to "$(SolutionDir)\Assets\$(Platform)\...

    The add a "Custom Build Step" to MainApp that goes something like this command: "copy $(SolutionDir)\Assets\$(Platform)\*.dll"

    make sure that you give it a dummy target output filename so that the custom build step is always run (this is important when you do your packaging).

    make sure that "Assets\Proj1.dll" and "Assets\Proj2.dll" are both added to your project and set as content.

    The only down side of this is that all dll's are alwasy copied every time you build which is a bit of disk churn, but i am able to build, package, validate, and upload to windows store my app packages.

    It would have been nice if you could give a symbolic name to a file that is added to your project, so instead of just having "Assets\Proj1.dll" in your project you would have "Assets\$(Platform)\Proj1.dll, but I could not get that to work.


    http://www.puttnutz.com

    Friday, January 04, 2013 10:52 PM