Thanks... I knew i could get it from code (should have mentioned that), but i really would like to read it from a config file.
Ik have a piece of code running that creates an Excel file of all running (Umbraco) websites with database name, path, check on SSL etc. but also the Umbraco version.
Apparently I have to create a custom config setting now with the version number... that's too bad. Since it won't change automaticly with an update of Umbraco.
Sounds interesting, not sure how your Excel is currently able to access the config files but perhaps create an API endpoint (secure it with a token or something?) that returns the data you need in json that Excel can request or something like that ;)
Umbraco version in config
Maybe i'm simply not seeing it, but in v8 and below we had this:
In v9 & v10 i can't seem to find the exact version code in any config file. Except for the generated models, they contain something like this:
(in this case the version is 10.2.1)
Is there any way to get the version from any of the config files?
Thanks for your reply! Dave Jonker
Hi Dave,
Not from config but there is a service called UmbracoVersion which you can inject.
e.g.
Jeavon
Hi Jeavon,
Thanks... I knew i could get it from code (should have mentioned that), but i really would like to read it from a config file.
Ik have a piece of code running that creates an Excel file of all running (Umbraco) websites with database name, path, check on SSL etc. but also the Umbraco version.
Apparently I have to create a custom config setting now with the version number... that's too bad. Since it won't change automaticly with an update of Umbraco.
Thanks anyway!
Dave
Sounds interesting, not sure how your Excel is currently able to access the config files but perhaps create an API endpoint (secure it with a token or something?) that returns the data you need in json that Excel can request or something like that ;)
It's just a simple console app that loops through all the websites in the root of our server and reads the web.config and/or appsettings.json file.
The version information is extracted from that and placed in a custom class with all the info.
If everything is collected an Excel sheet is generated with all the information, that's all :-)
Hi Dave, have you tried reading it from the .csproj file?
is working on a reply...