silverlight 4.0 - Extract assembly from all the dll's inside xap -
silverlight 4.0 - Extract assembly from all the dll's inside xap -
i have byte array silverlight xap . need extract dll's within xap byte array. 1 time dll's need extract assemblies it.silverlight xap stored in repository , repository homecoming me xap byte array .is there standard api available in c# accomplish functionality ?if not how can accomplish ?
regards,abhishek
create memorystream byte array , phone call function:
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)); } homecoming assemblies; }
silverlight-4.0 c#-4.0
Comments
Post a Comment