Answered by:
Is there a better way to package dll's built in the solution?

Question
-
I have some dlls used by the metro style application. These dlls are built in the same solution and output directory differs by the configuration. I put them into package by
- copy them to some fixed place after dll build by dll projects.
- build dll projects once to place them
- add binary in fixed place to application project and configure CopyToOutputDirectory
I think this approach is not straightforward. Is there a better way?
Thursday, March 1, 2012 9:37 AM
Answers
-
If these dlls are not metro style dlls (classic dlls), you need to set General -> "Support Metro Style Application" to "true" on the property page for the output of the projects to be packaged. Also, once the dlls are packaged, you can find them in the appx file (you can change the .appx extension to .zip to view the content of the zip file).
Li Shao, MSFT
Li Shao
- Marked as answer by Yoichi Nakayama Tuesday, March 13, 2012 5:45 AM
Monday, March 12, 2012 9:43 PM
All replies
-
Hi Yoichi,
If you metro application references these dlls, these dlls should be automatically packaged. Is that not the case for you?
Thanks,
Li Shao, MSFT
Li Shao
- Proposed as answer by Jesse Jiang Friday, March 2, 2012 2:45 AM
Thursday, March 1, 2012 6:50 PM -
Thank you. Yes, for .NET class library or Windows Runtime Component, adding reference in application project works well. But my question is not the case.
I'm talking about dlls without metadata, and be linked via import libraries or be loaded by LoadPackagedLibrary.
Friday, March 2, 2012 3:31 AM -
If you add reference from you metro app to the projects that producing these dlls, these dlls should be packaged.
Or you can add these dlls to your metro project as project items, make them as "content" of the project. You can set project items as content by setting the "content" property to "true" in the properties window.
Li Shao, MSFT
Li Shao
Friday, March 2, 2012 5:22 AM -
When I add reference from metro app project to non-winrt dll project, warning dialog pop-up. I proceed and reference is added. But dll will not be packaged.
Friday, March 2, 2012 7:39 AM -
Sorry for the delay. Did you do "Project to project" reference: add reference from you metro app to the projects that producing these dlls?
Li Shao, MSFT
Li Shao
Thursday, March 8, 2012 9:27 PM -
I did as follows(I'm using VS11 beta on Windows8 CP):
- In solution explorer, right click the application project and select "References..." in the menu
- Click "Add New Reference..." button and select native dll project file.
- In property page, "Full Path" under "Reference Properties" point to static library (import library created by dll project). Is It OK?
- Execute binary from Visual Studio, then it fails to run since dependent dll cannot be loaded.
- dll is not found in $(Configuration)\AppX\
- Edited by Yoichi Nakayama Monday, March 12, 2012 5:26 AM
Monday, March 12, 2012 5:25 AM -
If these dlls are not metro style dlls (classic dlls), you need to set General -> "Support Metro Style Application" to "true" on the property page for the output of the projects to be packaged. Also, once the dlls are packaged, you can find them in the appx file (you can change the .appx extension to .zip to view the content of the zip file).
Li Shao, MSFT
Li Shao
- Marked as answer by Yoichi Nakayama Tuesday, March 13, 2012 5:45 AM
Monday, March 12, 2012 9:43 PM -
It works. Thanks!
When I set "Metro Style App Support" in dll project, use of precompiled header is also changed (I think this is because default value is used). By selecting "Not Using Precompiled Headers", it come back to compile again. Then I add reference from application project to dll project, warning dialog does not pop-up, and Full Path point to winmd file. Finally I have dll&winmd in the package.
- Edited by Yoichi Nakayama Tuesday, March 13, 2012 5:55 AM
Tuesday, March 13, 2012 5:53 AM