© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•10mo ago•
7 replies
Core

✅ dotnet pack command fails

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

dotnet pack src/UaDetector --configuration Release --output packages
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.
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
.csproj
file
  <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>
  <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>
NuGet Error NU5026
NU5026 Error code
NuGet Error NU5026
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ Dotnet Command
C#CC# / help
3y ago
Dotnet ef command
C#CC# / help
3y ago
❔ dotnet publish docker fails
C#CC# / help
3y ago
How to pack dependencies with dotnet pack for a nupkg?
C#CC# / help
4y ago