-
Environment: .NET SDK 5.0.103, GitInfo 2.1.2 Have I did something wrong? Here is the csproj: <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net5.0;net5.0-windows</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup>
<PackageId>Crlib</PackageId>
<Version>$(GitBaseVersion)</Version>
<Authors>Rcmcpe</Authors>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<RepositoryUrl>$(GitRepositoryUrl)</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<RepositoryBranch>$(GitBranch)</RepositoryBranch>
<RepositoryCommit>$(GitCommit)</RepositoryCommit>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="GitInfo" Version="2.1.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
</Project> |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
The repository remote name is |
Beta Was this translation helpful? Give feedback.
-
You cannot get the values of properties before they are initialized. GitInfo initializes those properties in targets. You can retrieve them after GitInfo runs, like so: <Target Name="PopulateInfo" DependsOnTargets="GitInfo" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<PackageId>Crlib</PackageId>
<Version>$(GitBaseVersion)</Version>
<Authors>Rcmcpe</Authors>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<RepositoryUrl>$(GitRepositoryUrl)</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<RepositoryBranch>$(GitBranch)</RepositoryBranch>
<RepositoryCommit>$(GitCommit)</RepositoryCommit>
</PropertyGroup>
</Target> |
Beta Was this translation helpful? Give feedback.
You cannot get the values of properties before they are initialized. GitInfo initializes those properties in targets.
You can retrieve them after GitInfo runs, like so: