[SHARING] Get Dynamo Version Use Revit Addin

I saw that @john_pierson have a awesome opensource to get the version of dynamo here:

And I just want add more, we can use Dynamo.Applications.DynamoRevitApp.DynamoCorePath from assembly DynamoRevitDS.dll to know the location and get extract file assembly of each module :innocent:
Input:

using System;
using System.IO;
using System.Linq;
using System.Reflection;
using Dynamo.Applications;
public static string GetDynamoVersion()
  {
      string dynamoCoreDir = DynamoRevitApp.DynamoCorePath;
      string dynamoCorePath = Path.Combine(dynamoCoreDir, "DynamoCore.dll");
      // get version
      var dynamoCore = Assembly.LoadFrom(dynamoCorePath);
      return dynamoCore.GetName().Version.ToString();
  }
7 Likes