NuGet Error NU5026

The file ''F:\project\bin\Debug\net461\project.exe' to be packed was not found on disk.

Issue

The project being packed has not been built yet and hence cannot be packed.

Solution

Please build the project before running dotnet pack operation or do not use --no-build option to allow dotnet pack to build the project before packaging.

You may have written a project that does not output assemblies. If you intend to ship an assembly-free NuGet package, disable dotnet pack’s requirement for an output assembly. You can do this by setting the IncludeBuildOutput property to false in your project file.

Also see related msbuild properties.