• Set file version from powershell

    From priyabharti210895@gmail.com@21:1/5 to Josh Einstein on Sat Mar 16 00:48:30 2019
    On Sunday, March 29, 2009 at 10:56:22 PM UTC+5:30, Josh Einstein wrote:
    There's a .NET version (which is a part of the strong name, which is a part of the IL metadata) and there's a Win32 version. A versioned .NET assembly must be strong-named which means you can't change anything about the
    assembly after it's compiled otherwise the signature would be invalid and
    the assembly would fail to load.

    The Win32 information (which is also applicable to .NET assemblies and independent of the .NET version) can be changed by editing the appropriate resource but the same caveat applies. If the file is signed, changing the resource will break the signature.

    And finally one last bit of useless trivia... even though the version of a .NET assembly is added using the AssemblyVersionAttribute and FileVersionAttribute, many developers are surprised to learn that these attributes don't actually exist in the compiled assemblies. They are special and are converted to the appropriate metadata by the compiler.

    Josh

    "Marco Shaw [MVP]" <marco.shaw@NO_SPAMgmail.com> wrote in message news:ul026CvrJHA.4324@TK2MSFTNGP05.phx.gbl...
    David wrote:
    Is it possible to set a files "File Version" attribute from powershell.
    I want to loop through a directory and set the "File Version" attribute
    of all files within the directory to (lets say 1.0.0.1)

    That seems to be a read-only property in .NET. I'll keep looking and
    maybe someone else might have an idea...

    Marco

    --
    *Microsoft MVP - Windows PowerShell https://mvp.support.microsoft.com/profile/Marco.Shaw
    *Co-Author - Sams Windows PowerShell Unleashed 2nd Edition
    *PowerShell Co-Community Director - http://www.powershellcommunity.org *Blog - http://marcoshaw.blogspot.com

    I am also facing problem of setting version info after compilation. Iam ready to resign the files after changing version. But how to change version of executables is the question?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)