Skip to content

Commit 58321e0

Browse files
committed
Force Common library to take Version parameter
Allows for building from command line and receiving a consistent Version. Possibly important note: building directly from Visual Studio results in a 1.0.0.0 version.
1 parent bc0adc6 commit 58321e0

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

WinNUT_V2/WinNUT-Client_Common/WinNUT-Client_Common.vbproj

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,4 +135,16 @@
135135
</PackageReference>
136136
</ItemGroup>
137137
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
138+
<Target Name="BeforeBuild">
139+
<ItemGroup>
140+
<AssemblyAttributes Include="AssemblyVersion">
141+
<_Parameter1>$(Version)</_Parameter1>
142+
</AssemblyAttributes>
143+
</ItemGroup>
144+
<MakeDir Directories="$(IntermediateOutputPath)" />
145+
<WriteCodeFragment Language="VB" OutputFile="$(IntermediateOutputPath)Version.vb" AssemblyAttributes="@(AssemblyAttributes)" />
146+
<ItemGroup>
147+
<Compile Include="$(IntermediateOutputPath)Version.vb" />
148+
</ItemGroup>
149+
</Target>
138150
</Project>

0 commit comments

Comments
 (0)