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
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 293 |
Nodes: | 16 (2 / 14) |
Uptime: | 222:22:00 |
Calls: | 6,623 |
Calls today: | 5 |
Files: | 12,171 |
Messages: | 5,318,201 |