I have a Silverlight Unit test project which reads a xml file (build action of the xml in File properties is set to "Content") using XDocument.Load. The load and read operation is successful when i run it from VS. But it fails when
i run it from Statlight.
I poked around the Statlight src code and found this piece of code which reads the Silverlight Test project (SUT) xap and adds it to Statlight xap.
private byte RewriteXapWithSpecialFiles(byte xapHost, XapReadItems xapReadItems)
if (xapReadItems != null)
//TODO: maybe specify this list as something passed in by the user???
var specialFilesToCopyIntoHostXap = new List<string>
var filesToCopyIntoHostXap = (from x in xapReadItems.FilesContianedWithinXap
from specialFile in specialFilesToCopyIntoHostXap
where x.FileName.Equals(specialFile, StringComparison.OrdinalIgnoreCase)
xapHost = RewriteZipHostWithFiles(xapHost, filesToCopyIntoHostXap);
This section allows "ServiceReferences.ClientConfig" to be added to Statlight xap and rest are ignored. This impacts loading any file which is contained inside SUT xap and are not embedded resource.
Any reason behind this decision. What would be the best solution to this defect?.