Skip to content

Version.txt in model .zip should use the FileVersion, not AssemblyVersion #3132

Closed
@eerhardt

Description

@eerhardt

When you save a model, it generates a Version.txt file in the .zip, so we can tell which version of ML.NET was used to generate the model.

using (var ent = rep.CreateEntry(DirTrainingInfo, "Version.txt"))
using (var writer = Utils.OpenWriter(ent.Stream))
writer.WriteLine(typeof(RepositoryWriter).Assembly.GetName().Version);
return rep;

However, the issue is we are using the AssemblyVersion there, which isn't great information as all the models produced are showing:

1.0.0.0

We should write the FileVersion or AssemblyInformationalVersion instead, which will give us the exact build and SHA:

[assembly: AssemblyFileVersion("0.12.27526.3")]
[assembly: AssemblyInformationalVersion("0.12.27526.3 @BuiltBy: dlab14-DDVSOWINAGE101 @Branch: master @SrcCode: https://github.com/dotnet/machinelearning/tree/9caafb04d2b4f298f2a9479a9550597afee32c94+9caafb04d2b4f298f2a9479a9550597afee32c94")]

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions