How to manage versions in VS2010?

For example, after creating the Release version, I want the name to be changed to (for example) MyApp-1.2.exe . After I build the next version, I want the exe to be called MyApp-1.3.exe . I still want to be able to run MyApp-1.2.exe .

I would prefer not to use an external tool (I know there are nAnt and nMaven) and do it in VS. IF it's impossible than me, nAnt is the best bet for me.

+3
source share
2 answers

You can do this also through MSBuild using the GetAssemblyIdentity task :

<GetAssemblyIdentity
  AssemblyFiles="$(MSBuildProjectDirectory)\src\MyApp\bin\MyApp.exe">
  <Output
    TaskParameter="Assemblies"
    ItemName="AssemblyIdentities"/>
</GetAssemblyIdentity>

And then rename your .exe file:

<Copy 
    SourceFiles="$(MSBuildProjectDirectory)\src\MyApp\bin\MyApp.exe" 
    DestinationFiles="$(MSBuildProjectDirectory)\src\MyApp\bin\MyApp-(AssemblyIdentities.Version).exe"></Copy>
<Delete
    Files="$(MSBuildProjectDirectory)\src\MyApp\bin\MyApp.exe"></Delete>
+4

VS, () Post-build Command ( Project properties β†’ Build Events).

script , copy , . ( ) ( , ).

, .

IMHO .

+2

Source: https://habr.com/ru/post/1791725/


All Articles