CI/CD .exe and .dll versions


I am developing multiple .Net projects and i have to create a .gitlab-ci.yml file template that, with minimal changes would build a .sln file and copy .exe or .dll file to specific directory.
Build and copy portion is created and it works.
My question is - is it possible to read and store the .exe or .dll file version inside a variable for later use?