Skip to content

Commit

Permalink
Use assembly file version (fix #173)
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Ganss committed Mar 11, 2020
1 parent df15158 commit 89e1ff1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion XmlSchemaClassGenerator.Console/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Collections.ObjectModel;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
Expand Down Expand Up @@ -177,7 +178,7 @@ static void ShowHelp(OptionSet p)
{
System.Console.WriteLine("Usage: dotnet xscgen [OPTIONS]+ xsdFile...");
System.Console.WriteLine("Generate C# classes from XML Schema files.");
System.Console.WriteLine("Version " + typeof(Generator).Assembly.GetName().Version);
System.Console.WriteLine("Version " + typeof(Generator).Assembly.GetCustomAttribute<AssemblyFileVersionAttribute>().Version);
System.Console.WriteLine(@"xsdFiles may contain globs, e.g. ""content\{schema,xsd}\**\*.xsd"", and URLs.");
System.Console.WriteLine(@"Append - to option to disable it, e.g. --interface-.");
System.Console.WriteLine();
Expand Down
2 changes: 1 addition & 1 deletion XmlSchemaClassGenerator/VersionProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static VersionProvider CreateFromAssembly()
{
var executingAssembly = Assembly.GetExecutingAssembly();
var title = executingAssembly.GetCustomAttribute<AssemblyTitleAttribute>().Title;
var version = executingAssembly.GetName().Version.ToString();
var version = executingAssembly.GetCustomAttribute<AssemblyFileVersionAttribute>().Version;

return new VersionProvider(title, version);
}
Expand Down

0 comments on commit 89e1ff1

Please sign in to comment.