File tree 3 files changed +5
-1
lines changed
src/Nerdbank.GitVersioning.Tasks 3 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ Property | Default | Description
49
49
` NBGV_ThisAssemblyNamespace ` | (empty) | Sets the namespace to use for the generated ` ThisAssembly ` class.
50
50
` NBGV_EmitThisAssemblyClass ` | ` true ` | When ` false ` , suppresses generation of the ` ThisAssembly ` class.
51
51
` NBGV_ThisAssemblyIncludesPackageVersion ` | ` false ` | When ` true ` , a ` NuGetPackageVersion ` property is added to the ` ThisAssembly ` class.
52
+ ` NBGV_UseAssemblyVersionInNativeVersion ` | ` true ` | When ` false ` , uses the ` AssemblyFileVersion ` as a native ` PRODUCTVERSION ` .
52
53
53
54
### Custom ` ThisAssembly ` static fields and constants
54
55
Original file line number Diff line number Diff line change @@ -108,6 +108,8 @@ BLOCK NBGV_VERSION_BLOCK
108
108
109
109
public string TargetFileName { get ; set ; }
110
110
111
+ public bool UseAssemblyVersionInNativeVersion { get ; set ; } = true ;
112
+
111
113
/// <inheritdoc/>
112
114
public override bool Execute ( )
113
115
{
@@ -166,7 +168,7 @@ private void CreateDefines()
166
168
return ;
167
169
}
168
170
169
- if ( ! Version . TryParse ( this . AssemblyVersion , out Version productVersion ) )
171
+ if ( ! Version . TryParse ( this . AssemblyVersion , out Version productVersion ) || ! this . UseAssemblyVersionInNativeVersion )
170
172
{
171
173
productVersion = fileVersion ;
172
174
}
Original file line number Diff line number Diff line change 215
215
AssemblyLanguage =" $(AssemblyLanguage)"
216
216
AssemblyCodepage =" $(AssemblyCodepage)"
217
217
TargetFileName =" $(TargetFileName)"
218
+ UseAssemblyVersionInNativeVersion =" $(NBGV_UseAssemblyVersionInNativeVersion)"
218
219
/>
219
220
<!-- Avoid applying the newly generated Version.rc file to the build
220
221
unless it has changed in order to allow for incremental building. -->
You can’t perform that action at this time.
0 commit comments