Navigation: Actions > Microsoft > Make VS.NET > Make VS.NET / Delphi Prism Versions Tab |
|
This tab of the Make VS.NET / Delphi Prism action specifies versioning and base address settings.
Increment Version: The increment version option will increment the project version only if the project is built (the version is always incremented when specifying an individual RC or assembly file). This ensures that your installs work correctly and copies updated files when comparing the file version. After building or rebuilding a project, the original timestamp of the target executable is compared with the timestamp after building. If it has changed, the custom action increments the version and builds the project again (the second build will just recompile the resources and link).
For managed projects containing an AssemblyInfo file (Managed C++ .NET, Visual C# and VB.NET projects) and source code files, the AssemblyFileVersion (file version), AssemblyInformationalVersion (product version), and/or AssemblyVersion attributes in the project's AssemblyInfo file are created or updated. Normally, the 4th value (sometimes called the Revision number) is incremented, but the 3rd value (sometimes called the Build number) can be incremented instead by checking that checkbox.
For Visual C++ .NET projects, the FileVersion and/or ProductVersion fields within the resource file's VERSIONINFO resource are also incremented by extracting the last number in the version and incrementing it (the format is not changed).
Notes:
• | To update versions in .NET Core projects from this action, you must add an AssemblyInfo file to the project and the following element to each project file: |
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>
</Project>
• | VS.NET defaults the Assembly version to 1.0.* and uses the following logic when auto-incrementing: it sets the build part to the number of days since January 1st, 2000, and sets the revision part to the number of seconds since midnight, local time, divided by two. The Make VS.NET action will not change the 1.0.* value when using its Increment option. To override VS.NET's increment logic, temporarily set the Assembly version to a specific value (i.e., 1.0.0.0) and build the step, then using the Make VS.NET action's Increment option will increment the version by a single digit (and will also allow the Get VS.NET Version action to retrieve the actual version value). |
• | VS.NET 2002/2003 does not implement true incremental build intelligence for C# and VB.NET projects; a project's assembly executable is always updated even if no source files were changed since the last build, which will always cause the version to be incremented for these project types when using the Increment Version option. |
• | The Set and Increment version capabilities are not supported and will be ignored for Visual Studio 2005 and later web projects. |
Set Version: The set version option will set the specified version fields to the provided value. This is useful if you want your executables to be marked with a specific build number. The version should be entered in the format 9.9.9.9 (e.g., 1.0.1.12). The version(s) are updated in the resource file(s)/AssemblyInfo file before building.
For Visual C++ .NET projects containing resource files, the raw version will be stored in the required "9, 9, 9, 9" format, while the string version will be stored exactly as entered; for managed projects containing an assemblyinfo file, the version number is set to the value specified.
When using the Increment or Set Version radio button, one or more of the File, Product, and Assembly version checkboxes should be checked to indicate which version(s) to increment or set.
Notes:
• | To set a different value for each of the version fields, create multiple Make VS.NET Action steps for a single project/solution, with all but the last having its Don't build field checked; then set a specific version field in each of the steps. These steps could be placed in a subroutine if different versions needed to be set on multiple projects or solutions. |
• | To exclude a single project in a multi-project managed solution from version set/increment, rename that project's AssemblyInfo file (i.e., AssemblyInfox.cs) in the VS.NET IDE, and the Make VS.NET action will not update versions or properties for that project. |
• | Only the Assembly and Product versions apply for Smart Device (Compact Framework) projects; the File version option should be unchecked for these project types. |
• | For C# and VB.NET projects, if only the Assembly version is set/incremented, VS.NET will also assign that version for the file and product version fields in the executable (if a file or product version attribute is already set it will need to be removed from the projects' AssemblyInfo. files and the projects rebuilt). |
• | For Setup and Deployment projects, the ProductVersion field will be set or incremented if Update the Product version is checked. To update the Product Code with a new GUID, use a Replace in File action with Text or regular expression to find of |
"ProductCode"\s*=\s*"8:([^"]*)"
and Text or regular expression to replace matches with of
"ProductCode" = "8:[CreateObject("Scriptlet.Typelib").Guid]"
Base Address: Normally all projects are set to the same default address, requiring most of the DLLs to be "rebased" when they are loaded into a process. By setting the base address on each project, your application will run faster since the relocation is eliminated.
If Random value is selected, a random address will be chosen for each project and the project file will be updated with that value (this is only done if the value is still set to its default value, so after the first time this is set it will not be changed when a project is built again). Since there are over 24,000 unique base addresses available, the likelihood is very good that each component loaded into a single process will get a unique address.
If Set to a specific value is selected, the base address for the project will be set to that value (it must be in the range 1000000 to 7000000 hex). This option should only be used for single project solutions.
Notes: The Base Address option does not apply for Smart Device (Compact Framework) or managed Visual Studio 2005 and later projects.