Page 1 of 1
Current compiler version in versionsinfo
Posted: Tue Jun 18, 2019 5:31 am
by wriedmann
Hello,
in my VO programs I'm using the following in the VersionsInfo ressource:
Code: Select all
resource VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,25,18,__version__
PRODUCTVERSION 1,25,18,__version__
.....
The __version__ will be replaced by the compiler version.
I would like to see something also in X# - so I can see from the explorer with which version the binary was compiled.
I need that not only for the ressource (I remember the discussion from a few days ago...), but also for the AssemblyInfo part.
Specially now with the very active development, something like this seems important to me.
Wolfgang
Current compiler version in versionsinfo
Posted: Tue Jun 18, 2019 6:42 am
by robert
Wolfgang,
I'll see what I can do. But I can't do it 100% identical to VO:
VO operates quite differently from X# in this area: it stores the resource in the repo and when it writes the repo to disk for the RC compiler it actually does a case insensitive search/replace and replaces the version.
We are already working with external files and we are building a commandline for the resource compiler in our XSharp.Build.dll that has the task to build native resources. This command line "simply" #includes all .rc files in a response file.
You can see this in
https://github.com/X-Sharp/XSharpPublic ... urceGen.cs
I can probably add a #define __VERSION__ 1.2.3.4 in the reponse file for the resource compiler. But... that #define will be case sensitive. So I could also add #define __version__ 1.2.3.4. But that would not work for defines in mixed case.
Is that OK with you ?
Btw: did you know that if you compile an app that is not Core we also add an attribute to that assembly with the compiler version and dialect:
[assembly: CompilerVersion("X# 2.0.2.0 - dialect:Vulcan")]
Robert
Current compiler version in versionsinfo
Posted: Tue Jun 18, 2019 6:57 am
by wriedmann
Hi Robert,
can probably add a #define __VERSION__ 1.2.3.4 in the reponse file for the resource compiler. But... that #define will be case sensitive. So I could also add #define __version__ 1.2.3.4. But that would not work for defines in mixed case.
thank you very much! Upper case is enough, if we know that. I would not add also a lower case replace because it creates only confusion, I think.
Btw: did you know that if you compile an app that is not Core we also add an attribute to that assembly with the compiler version and dialect:
[assembly: CompilerVersion("X# 2.0.2.0 - dialect:Vulcan")]
No, I didn't knew that.
But how can I see that? The file properties in Windows Explorer don't show these attributes, unfortunately.
Therefore I need the VersionInfo resource and not the newer AssemblyInfo.
Thank you for this wonderful tool - I'm very happy with X#!
Wolfgang
Current compiler version in versionsinfo
Posted: Tue Jun 18, 2019 7:05 am
by robert
Wolfgang,
1) Please create an issue (feature request) for this on Github. Click the [Tickets] button on the top of this page to go to Github. That way you'll be kept informed about the progress.
2) Indeed to see the Compilerversion attribute you need to open the assembly with IlSpy or Reflector.
Robert
Current compiler version in versionsinfo
Posted: Tue Jun 18, 2019 7:12 am
by wriedmann
Hi Robert,
done, thank you very much!
Wolfgang