nuke-build / nuke

🏗 The AKEless Build System for C#/.NET
https://nuke.build
MIT License
3.07k stars 367 forks source link

GitVersion.Tool PackageDownload Error #1362

Closed leorg99 closed 7 months ago

leorg99 commented 7 months ago

Usage Information

Nuke 8.00 / .NET SDK version 8.0.204 / Linux,.NETCoreApp,Version=v8.0

Description

Running in Debian, I get the following error:

NUKE Execution Engine version 8.0.0 (Linux,.NETCoreApp,Version=v8.0)
​
14:20:48 [WRN] Could not inject value for IHazGitVersion.Versioning
System.Exception: Missing package reference/download.
Run one of the following commands:
  - nuke :add-package GitVersion.Tool --version 5.12.0
  - nuke :add-package GitVersion.CommandLine --version 5.12.0
 ---> System.ArgumentException: Could not find package 'GitVersion.Tool' or 'GitVersion.CommandLine' using:
 - Project assets file '/tmp/Radancy.MongoDB.Context/build/obj/project.assets.json'
 - NuGet packages config '/tmp/Radancy.MongoDB.Context/build/_build.csproj'

Binlog: msbuild.binlog.zip

Seems related to #1206

Reproduction Steps

I am running nuke pack

My _build.csproj:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net8.0</TargetFramework>
    <RootNamespace></RootNamespace>
    <NoWarn>CS0649;CS0169;CA1050;CA1822;CA2211;IDE1006</NoWarn>
    <NukeRootDirectory>..</NukeRootDirectory>
    <NukeScriptDirectory>..</NukeScriptDirectory>
    <NukeTelemetryVersion>1</NukeTelemetryVersion>
    <IsPackable>false</IsPackable>
    <ManagePackageVersionsCentrally>false</ManagePackageVersionsCentrally>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Nuke.Common" Version="8.0.0" />
    <PackageReference Include="Nuke.Components" Version="8.0.0" />
  </ItemGroup>

  <ItemGroup>
    <PackageDownload Include="GitVersion.Tool" Version="[5.12.0]" />
  </ItemGroup>

</Project>

Expected Behavior

Should download GitVersion.Tool package

Actual Behavior

Exits with error

Regression?

No response

Known Workarounds

No response

Could you help with a pull-request?

No

leorg99 commented 7 months ago

Just figured out. Deleted nuget.config in the solution directory and it worked. Not sure which part yet it doesn't like.

<?xml version="1.0" encoding="utf-8"?>
<configuration>

  <!-- Create a repo-specific global packages folder for full security benefit -->
  <config>
    <add key="globalPackagesFolder" value="globalPackagesFolder" />
  </config>

  <packageRestore>
    <add key="enabled" value="True" />
    <add key="automatic" value="True" />
  </packageRestore>

  <!-- Declare package sources/feeds -->
  <packageSources>
    <!-- To inherit the global NuGet package sources remove the <clear/> line below -->
    <clear />
    <add key="nuget" value="https://api.nuget.org/v3/index.json" />
    <add key="nexus" value="private nuget" />
  </packageSources>

  <packageSourceMapping>
    <clear />
    <packageSource key="nuget">
      <package pattern="*" />
    </packageSource>
    <packageSource key="nexus">
      <package pattern="Namespace1*" />
      <package pattern="Namespace2*" />
    </packageSource>
  </packageSourceMapping>

</configuration>
leorg99 commented 7 months ago

Very strange. I literally deleted it and recreated the file and it worked. Only difference is that it was initially named Nuget.Config and i recreated it as nuget.config.

willsmith9182 commented 7 months ago

case sensitivity bites again :)