portable class library - Get assembly version in PCL -
i have following line of code in .net 4.5 trying build portable class library. it's purpose assembly version:
this.gettype().assembly.getname().version.major;
the problem assembly.getname() not available in pcl. there way assembly version in pcl?
i know possible parse assembly.fullname, want better solution.
public static string version { { var assembly = typeof(mytype).gettypeinfo().assembly; // in pcl profiles above line is: var assembly = typeof(mytype).assembly; var assemblyname = new assemblyname(assembly.fullname); return assemblyname.version.major + "." + assemblyname.version.minor; } }
Comments
Post a Comment