问题
I have an app for Android that I'm porting to Windows Phone 8 now.
The assets folder lies apart of code in my folder sturucture. In order to include it into Android build, I use <linkedResources>
.
Is there anything similar for Windows Phone 8 and MSVC? Having examined examples, I found they all include assets directly into project folder structure in Visual Studio. Can I avoid copying assets into MSVC project folder?
BTW, my MSVC 2013 does not have drop box on Add
button:
回答1:
This an old Silverlight trick when there was common entity
code files which needed to be shared between the app and the service where the library could not be brought in due to the differences in .Net.
The trick is to include as a link into the project. Here is how
- In the assets folder of the WP8 phone project right click and select
Add
thenExisting Item...
orshift
alt
A
. - Browse to the location of the file(s) found in the android project and select the file(s).
- Once the item(s) have been selected, then on the
Add
button select the drop down arrow. - Select
Add as link
to add the image(s) as a link into the folder.
That will give access to the file as if the file was actually within the project's Asset
folder, but the file physically resides elsewhere.
来源:https://stackoverflow.com/questions/24432598/assets-folder-for-windows-8-phone-app