Posted on 19/11/2014 11:51:31
I like Imar's suggestion to scrape the version number from the login page. :-)
You don't have to use reflection to get the version number from Dynamicweb; just use Dynamicweb.Base.DWAssemblyVersionInformation().
Per, you can consider adding an ashx script to all your running solution and make that script return exactly the information you need. A simple example is
<%@ WebHandler Language="C#" Class="Handler" %>
using System;
using System.Web;
public class Handler : IHttpHandler {
public void ProcessRequest (HttpContext context) {
context.Response.ContentType = "application/json";
context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(new {
Version = Dynamicweb.Base.DWAssemblyVersionInformation(),
AssemblyVersion = Dynamicweb.Base.DWAssemblyVersion
}));
}
public bool IsReusable {
get {
return false;
}
}
}
If you put this in Files/System/info.ashx you can get the solution information by loading http://«domain»/Files/System/info.ashx.
I'm not a security expert, but I would be very careful with exposing too much public information about my running Dynamicweb solutions, and the example script should be protected by some security measures.
Best regards,
Mikkel