You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/usage/command-line.md
+31-1Lines changed: 31 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -24,4 +24,34 @@ It will update the following assembly attributes:
24
24
25
25
Note that contrary to when using the [MSBuild Task](msbuild-task.md) the attributes must already exist in the `AssemblyInfo.cs` or `AssemblyInfo.vb` files prior to calling GitVersion.
26
26
27
-
By adding `/updateassemblyinfofilename` the name of AssemblyInfo file to update can be set.
27
+
By adding `/updateassemblyinfo <filenames>` the name of AssemblyInfo file to update can be set. This switch can accept multiple files with the path to the file specified relative to the working directory.
28
+
29
+
GitVersion can generate an assembly info source file for you if it does not already exist. Use the `/ensureassemblyinfo` switch alongside `/updateassemblyinfo <filename>`, if the filename specified does not exist it will be generated based on a known template that adds:
30
+
31
+
*`AssemblyVersion` will be set to the `AssemblySemVer` variable.
32
+
*`AssemblyFileVersion` will be set to the `MajorMinorPatch` variable with a appended `.0`.
33
+
*`AssemblyInformationalVersion` will be set to the `InformationalVersion` variable.
34
+
35
+
This can be done for *.cs, *.vb and *.fs files.
36
+
37
+
When requesting that GitVersion generate an assembly info file you are limited to only specifying a single `<filename>` within the `/updateassemblyinfo` switch, this is to prevent the creation of mulitple assembly info files with the same assembly version attributes. If this occurs your build will fail.
0 commit comments