PackageCatalog: Getting the EntryPoint Assembly

Jan 4, 2010 at 2:52 AM
Edited Jan 4, 2010 at 2:53 AM

I've just cracked open the PackageCatalog (after learning more about it in Mike Taulty's excellent video on it here), and it's a wonderful thing indeed!

One thing that would be really useful would be this.  The returned 'Package' object contains the list of Assemblies within the XAP.  Highlighting out in a seperate property the EntryPointAssembly for that XAP would be most handy.

At the moment I'm doing this by manually downloading the XAP file and examining the manifest (with AssemblyPart), but I want to move all this code over to MEF and leverage this PackageCatalog box of wonders.

Is there a way to get the EntryPoint Assembly information back out of PackageCatalog at all?  If not, would be a wonderful thing to include as a property on Package.

Many thanks!!!

--

Phil

Jan 4, 2010 at 3:05 AM

In examining this more closely, I'm seeing that the First entry within the Package.Assemblies enumerable is the entry-point assembly.  

Is this guaranteed to be the entry-point? Is the order stable?

Thanks big brained MEF-ers.

--

Phil

Jan 4, 2010 at 3:32 AM

can u check against Assembly.GetEntryAssembly()?

Jan 4, 2010 at 3:55 AM

Thanks natl.

I'm working in Silverlight, and it looks like GetEntryAssembly() is not implemented out on the client.

Also, I'm not sure that would do the trick, as it would (I think) return the initially loaded assembly within the AppDomain...not the entry-assembly of the freshly downloaded XAP file.  Could be being thick though in this assumption.

PackageCatalog seems to be pretty consistently returning the entry-assembly as the first item...however that's no a guarantee.  It'd be nice to have it guaranteed by it being called out as it's own property.

Thanks

Jan 4, 2010 at 4:21 AM
Edited Jan 4, 2010 at 4:30 AM

Totally forgot that EntryAssembly is about deployment. Shouldn't you figure it out from Deployment.Current.EntryPointAssembly?