0

So I have 8 different silverlight projects in visual studio 2012 that produce 8 different XAP files. Each project has an "Assets" directory that contains applicationicon.png and a tiles directory which contains yet even more PNG files.

I'm just testing some things out, but what I want to do is make it so that each different XAP project I have doesn't all have its own copy of the PNG files it needs.

How do I make it so there is a common directory that all these projects can look at for common files (such as the icons)?

Is this possible?

2 Answers2

0

When you add files to your project, there is a dropdown on the add button that allows you to link to a file without copying it to your project. That way, you don't have duplicates.

Visual Studio: Add Item / Add as link rather than just Add

Community
  • 1
  • 1
kindasimple
  • 2,427
  • 1
  • 16
  • 20
  • I tried what you mentioned, but it still won't find the "ApplicationIcon.png" file when I add it as a link in the project. I also tried modifying the WMAppManifest.xml to point to it saying "..\CommonFiles\ApplicationIcon.png" still no go when visual studio tries to build. It still says it can't find the ApplicationIcon.png. Update: When I specify "..\CommonFiles\ApplicationIcon.png" it does compile and put it in the XAP file, but when I deploy the application it doesn't show up. – checkingthingsout Mar 02 '13 at 02:20
  • Check the properties of the linked assets to make sure that the BuildAction property is set to Content – kindasimple Mar 03 '13 at 15:12
0

Another option is to create a common project instead of a common directory.

The common project can contain all shared assets and user controls, but it doesn't build its own XAP. Include the common project as a reference in the other XAP projects. You can then refer to those common items using the common project's namespace.

All projects then point to the same image files. This is also useful when you want to use the same user controls in multiple XAPs.