Possible feature to control the versioning of projects

We’ve been using your script editor for a couple of months now and we’ve been very happy with the results but we’ve recently ran into an issue that we’re not sure how to solve and we think that having the option to manipulate the assembly versions of the editor projects could help.

We basically want the ability to increase the assembly version of the output library every time it gets built and as long as I can see, this is not implemented anywhere in your source code.

Is this a feature that is planned on being added or is this something that could be done?

Regards, Lucas.

Hi Lucas,

In AlterNET Studio 9.5 we’ve added assembly version generation for SDK-style projects (in case GenerateAssemblyInfo and Version properties are set).

It should still be possible to generate an assembly version for other scenarios by overriding the GenerateAssemblyInfo method like this:

public class MyScriptHost : RoslynScriptHost
{
    public string AssemblyVersion { get; set; }

  protected override string GenerateAssemblyInfo()
  {
      if (!string.IsNullOrEmpty(AssemblyVersion))
      {
          switch (ScriptRun.ScriptLanguage)
          {
              case ScriptLanguage.VisualBasic:
              case ScriptLanguage.VisualBasicScript:
                  return VisualBasicScriptProvider.GenerateAssemblyInfo(AssemblyVersion);
              case ScriptLanguage.CSharp:
              case ScriptLanguage.CSharpScript:
                  return CSharpScriptProvider.GenerateAssemblyInfo(AssemblyVersion);
          }
      }

      return base.GenerateAssemblyInfo();
  }
}

Kind regards,
Dmitry

I had taken a look at that but seems like changing the assembly version there does not change the output dll’s version. Plus, we’d also need the capability to read what the current version of the project is.

So ideally we’d have access to the project’s version to read and increment it.

Hi Lukas,

I’ve sent you an email with more information; this code has the same effect as adding the assembly info file with the assembly version attributes to the project.

Kind regards,
Dmitry