A XAP file is just a Zip file that has a different extension. You can easily use libraries like SharpLib or DotNetZip to extract the contents of it. You can also manualy change the extension of a .xap file to .zip and then extract it in a folder. When extracted, you would get all the assemblies that were bundled as part of the .xap file.
While exploring today on extracting assemblies from a .zap file, I came across this code snippet that can be used to extract assemblies from a XAP file:
public List<Assembly> ExtractAssembliesFromXap(Stream stream) {
List<Assembly> assemblies = new List<Assembly>();
string appManifest = new StreamReader(Application.GetResourceStream(
new StreamResourceInfo(stream, null), new Uri("AppManifest.xaml",
UriKind.Relative)).Stream).ReadToEnd();
XElement deploy = XDocument.Parse(appManifest).Root;
List<XElement> parts = (from assemblyParts in deploy.Elements().Elements()
select assemblyParts).ToList();
foreach (XElement xe in parts) {
string source = xe.Attribute("Source").Value;
AssemblyPart asmPart = new AssemblyPart();
StreamResourceInfo streamInfo = Application.GetResourceStream(
new StreamResourceInfo(stream, "application/binary"),
new Uri(source, UriKind.Relative));
assemblies.Add(asmPart.Load(streamInfo.Stream));
}
return assemblies;
}
This code is taken from this link: http://stackoverflow.com/questions/3801065/extract-assembly-from-all-the-dlls-inside-xap
Thanks,
Joydip