It's easy to get list of all loaded assemblies in .NET:
AppDomain.CurrentDomain.GetAssemblies()
But I can't find a way to do this in PCL (portable class library) code? Any suggestions?
It's easy to get list of all loaded assemblies in .NET:
AppDomain.CurrentDomain.GetAssemblies()
But I can't find a way to do this in PCL (portable class library) code? Any suggestions?
Not sure if Deployment.Current.Parts is available in PCL, but I use:
public static List<Assembly> GetAssemblies()
{
List<Assembly> assemblies = new List<Assembly>();
foreach (var assemblyPart in Deployment.Current.Parts)
{
StreamResourceInfo sri = Application.GetResourceStream(new Uri(assemblyPart.Source, UriKind.Relative));
Assembly a = new AssemblyPart().Load(sri.Stream);
if (a != null)
assemblies.Add(a);
}
return assemblies;
}