|
-
May 21st, 2008, 06:46 AM
#1
Thread Starter
Frenzied Member
[3.0/LINQ] Dynamically Modify EXE version at build time?
Hey guys!
I've been trying to find a solution to this for a while, reading a few threads here and there but not really finding what I need. I'm trying to dynamically modify an EXE's version at build time to match that of another EXE in the same directory as the file.
No solutions are apparent to me but hopefully someone here will have a clue as to how that can be done.
Thanks!
-
May 21st, 2008, 12:23 PM
#2
Re: [3.0/LINQ] Dynamically Modify EXE version at build time?
Well considering that the version is compiled into the executable I don't think this is possible unless you're recompiling the application on the fly with an updated assembly.
Why would you need to do something like this? It defeats the purpose of versioning.
-
May 21st, 2008, 12:50 PM
#3
Thread Starter
Frenzied Member
Re: [3.0/LINQ] Dynamically Modify EXE version at build time?
It's complicated but I simply want the versions of all the EXE's to be the same. It's an addon for another program and I'd like it to be the same as the host application so everything matches up.
-
May 21st, 2008, 01:24 PM
#4
Re: [3.0/LINQ] Dynamically Modify EXE version at build time?
I can think of two options:
1) Create an application that reads the assembly version from the target executable (hint: System.Reflection.AssemblyName class, Version property) & then modifies the appropriate AssemblyInfo.cs file, and launch it from the pre-build event [Project properties > Build events].
This won't play well with version controlled files, unless you couple the application up to the source control provider of choice.
2) Create a plug-in that does what (1) does, except now you have access to Visual Studio's API for source control fun. The difference in launching is that you would now use the appropriate pre-build event provided by the API.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|