C#C
C#8mo ago
Core

✅ dotnet pack command fails

Hello,
I'm trying to package a library, but dotnet pack fails to create the package.
The docs says I should build the project it beforehand, or not use the --no-build flag, but I didn't specify the flag.
https://learn.microsoft.com/en-us/nuget/reference/errors-and-warnings/nu5026

c#
dotnet pack src/UaDetector --configuration Release --output packages

The file '/home/runner/work/UaDetector/UaDetector/src/UaDetector/bin/Release/net462/UaDetector.dll' to be packed was not found on disk.


Below is the .csproj file
c#
  <PropertyGroup>
    <OutputType>Library</OutputType>
    <TargetFrameworks>netstandard2.0;net462;net6.0;net8.0;</TargetFrameworks>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
    <LangVersion>latest</LangVersion>
    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
    <GeneratePackageOnBuild>true</GeneratePackageOnBuild>
    <PackageId>UaDetector</PackageId>
    <Version>1.0.0-preview.1</Version>
    <Authors>Bill</Authors>
    <RepositoryType>git</RepositoryType>
/PackageTags>
  </PropertyGroup>
NU5026 Error code
Was this page helpful?