views:

98

answers:

1

I have a certain config.xml file in one of my projects (Silverlight class library) in a folder in the solution. It's build action is set to content. In that same project I am trying to load the xml file by saying:

XDocument xml = XDocument.Load("/config.xml");

This unfortunately is not working. Upon inspecting the xap file, I see that the xml file is not being copied to it. I am using Visual Studio 2010 RC.

+1  A: 

You need to include the file marked 'Content' in the main application's project to get it to show up in the .Xap. If you control the main app, you could link in the .xml file and mark it as Content.

If you can't do that, mark the .xml file as an Embedded Resource, it's less flexible and will be built into the .dll, but that is your only other option.

Jeff Wilcox