views:

14

answers:

1

Why do I have to rebuild my project everytime to see the new silverlight xap file created in my browser

a little more background info:

this is the structure of my setup

solution
 |-project1(asp.net website)
     |- Client Bin
        |- xap file
     |- Xml file

 |-project2(silverlight project)
     |- Shortcut to Xml file (added as link)

Xml file is updated by project1, project 2 is supposed to generate something based on the value of Xml file. However I have to rebuild project every time to see these changes

+1  A: 

I'm not sure I entirely understand your question -- because to me it seems pretty obvious. The XAP file gets created (or updated) when you build your project, because it contains the DLLs and other resources that Silverlight needs to run your application. So when you build your solution, Visual Studio builds those DLLs and resources, and combines and compresses them into a XAP file. How else would you expect it to work?

Ken Smith
so I have this XML file which updates how my XAP chart gets made and I want it to change everytime I edit the XML without having to rebuild the project.
anon5
My recommendation, then, would be to retrieve the XML file dynamically (from the hosting website), rather than including it as a part of the XAP file. The XAP file is specifically for things that get updated at compile time. You could also presumably hack the XAP file (it's just a .zip file, with a different extension), and update the XML file manually, but that doesn't smell right to me. I'd recommend loading the XML file dynamically instead.
Ken Smith
I changed the properties of the XML file to "copy always" but it still doesnt seem to be updating the Chart. Also I opened the xap and there is no xml file in there so it was never part of the xap in the first place I guess. What would be the best way to access the xml dynamically
anon5
please see more info in edit
anon5