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

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -