File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed
Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change 8282
8383internal class AssemblyInfo
8484{
85- private static string version ;
85+ private static string version = null ;
86+
8687 public static string Version
8788 {
8889 get
@@ -91,21 +92,26 @@ public static string Version
9192 {
9293#if PORTABLE
9394#if NEW_REFLECTION
94- var ver = ( AssemblyVersionAttribute ) typeof ( AssemblyInfo ) . GetTypeInfo ( ) . Assembly . GetCustomAttributes ( typeof ( AssemblyVersionAttribute ) ) . FirstOrDefault ( ) ;
95+ var a = typeof ( AssemblyInfo ) . GetTypeInfo ( ) . Assembly ;
96+ var c = a . GetCustomAttributes ( typeof ( AssemblyVersionAttribute ) ) ;
9597#else
96- var ver = ( AssemblyVersionAttribute ) typeof ( AssemblyInfo ) . Assembly . GetCustomAttributes ( typeof ( AssemblyVersionAttribute ) , false ) . FirstOrDefault ( ) ;
98+ var a = typeof ( AssemblyInfo ) . Assembly ;
99+ var c = a . GetCustomAttributes ( typeof ( AssemblyVersionAttribute ) , false ) ;
97100#endif
98- if ( ver != null )
101+ var v = ( AssemblyVersionAttribute ) c . FirstOrDefault ( ) ;
102+ if ( v != null )
99103 {
100- version = ver . Version ;
104+ version = v . Version ;
101105 }
102106#else
103107 version = Assembly . GetExecutingAssembly ( ) . GetName ( ) . Version . ToString ( ) ;
104108#endif
105109
106110 // if we're still here, then don't try again
107111 if ( version == null )
112+ {
108113 version = string . Empty ;
114+ }
109115 }
110116
111117 return version ;
You can’t perform that action at this time.
0 commit comments