Results 1 to 4 of 4

Thread: [3.0/LINQ] Dynamically Modify EXE version at build time?

  1. #1

    Thread Starter
    Frenzied Member sciguyryan's Avatar
    Join Date
    Sep 2003
    Location
    Wales
    Posts
    1,763

    [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!
    My Blog.

    Ryan Jones.

  2. #2
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985

    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.
    KrisSiegel.com - My Personal Website with my blog and portfolio
    Don't Forget to Rate Posts!

    Free Icons: FamFamFam, VBCorner, VBAccelerator
    Useful Links: System.Security.SecureString Managed DPAPI Overview Part 1 Managed DPAPI Overview Part 2 MSDN, MSDN2, Comparing the Timer Classes

  3. #3

    Thread Starter
    Frenzied Member sciguyryan's Avatar
    Join Date
    Sep 2003
    Location
    Wales
    Posts
    1,763

    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.
    My Blog.

    Ryan Jones.

  4. #4
    Frenzied Member axion_sa's Avatar
    Join Date
    Jan 2002
    Location
    Joburg, RSA
    Posts
    1,724

    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
  •  



Click Here to Expand Forum to Full Width