0
votes

I am working on a Silverlight library project in a big solution. I added an XML file to my project and set its Build Action to Content. As far as I can understand this is supposed to deploy the XML in the XAP file. But when I open the XAP in ClientBin, it is missing. I have tried a couple of times, I have cleaned the solution, I have stopped the VS development server and run it again. Nothing is working.

I noticed that if I set the Build Action to Resource, the file actually gets attached to the dll (the size of the dll file increases), but the Content thing is not working.

I am using VS 2010 and Silverlight 4. Did anyone have the similar issue?

2

2 Answers

0
votes

Apparently, I have found the reason for that behavior. As I said, I was writing a dll in a big solution, which was referenced by other projects. When I build the solution, it packs all the referenced projects into the XAP of the main project. That's why the content xml was not being copied to XAP, because it was not the XAP of its "parent project", and it's parent projects acted just as a referenced dll inside the XAP. I just moved the required XML to the main project and it fixed everything.

Anyway, I think that's a VS bug. Even if the project just sits there as a reference in XAP, VS should have deployed its resources to the XAP as well.

Thanks to everyone who read the question and tried to help. I hope this will be useful to someone.

0
votes

When set a file build action to Content, you need also to set the property "copy to output directory" to copy if newer or copy always, by default is established in copy never....