Change Assembly Version in a compiled .NET assembly

前端 未结 6 1934
攒了一身酷
攒了一身酷 2020-12-01 05:17

Simple question... is there a way to change the Assembly Version of a compiled .NET assembly?

I\'d actually be fine with a way to change the Assembly File Version.

6条回答
  •  情歌与酒
    2020-12-01 05:40

    Old topic but here are my 5 dimes...

    1. Disassemble

      ildasm my.exe /output:my.il /metadata

    2. Edit my.il to change version information. There are several places to look into:

      • major:minor:revision:build - usually one occurrence
      • major.minor.revision.build - several occurrences. The string is found in the comment section after the actual line. The version is a hexadecimal value in a byte array. Example:

    .custom instance void [mscorlib]System.Reflection.AssemblyFileVersionAttribute::.ctor(string) = ( 01 00 07 35 2E 31 2E 33 2E 30 00 00 ) // ...5.1.3.0..

    1. Edit my.res to change version information. Double click and edit with visual studio. Pretty straight forward procedure.

    2. Assemble

      ilasm my.il /res:my.res

提交回复
热议问题