Git version wird richtig geparsed

This commit is contained in:
HuskyTeufel
2022-03-30 15:16:36 +02:00
parent 06cb2572ff
commit ecda2ab44f
3 changed files with 16 additions and 1 deletions

View File

@@ -7,6 +7,16 @@
<UseWPF>true</UseWPF>
</PropertyGroup>
<ItemGroup>
<None Remove="version.txt" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="version.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.0">
<PrivateAssets>all</PrivateAssets>
@@ -28,4 +38,8 @@
</None>
</ItemGroup>
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
<Exec Command="git rev-parse HEAD &gt; $(ProjectDir)\version.txt" />
</Target>
</Project>

View File

@@ -103,7 +103,7 @@ namespace DaSaSo.Wpf.ViewModel
{
string gitVersion;
#pragma warning disable CS8600 // Converting null literal or possible null value to non-nullable type.
using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("DaSaSo.ViewModel.version.txt"))
using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("DaSaSo.Wpf.version.txt"))
#pragma warning restore CS8600 // Converting null literal or possible null value to non-nullable type.
#pragma warning disable CS8604 // Possible null reference argument.
using (StreamReader reader = new(stream))