I have the following line of code in .NET 4.5 that I am trying to build as Portable Class Library. It\'s purpose is to get assembly version:
this.GetType().A
public static string Version
{
get
{
var assembly = typeof(MyType).GetTypeInfo().Assembly;
// In some PCL profiles the above line is: var assembly = typeof(MyType).Assembly;
var assemblyName = new AssemblyName(assembly.FullName);
return assemblyName.Version.Major + "." + assemblyName.Version.Minor;
}
}