'Packing the Project didn't create nupkg file (Visual Studio 2022)
I followed this guide: https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package-using-visual-studio?tabs=netcore-cli for creating a nupkg file locally for my project (until run the pack command).
Steps to reproduce:
Created a project (and added the code) - net 5.0
Right Click on the project and then left click on pack
Message from the build: ========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
But, my nupkg file wasn't created, what could cause this issue?
Update: I tried cleaning the solution then packing it again and it still didn't help.
In addition, I tried to run it with:
donet pack
and I got these message in verbose mode:
1>Project "PROJECT_PATH" on node 1 (Restore target(s)). 1>_GetAllRestoreProjectPathItems: Determining projects to restore... Restore: Committing restore... Assets file has not changed. Skipping assets file writing. Path: PROJECT_PATH\obj\project.assets.json Restored PROJECT_PATH\PROJECT.csproj (in 39 ms).
NuGet Config files used: NUGET_CONFIG_PATH
Feeds used: https://api.nuget.org/v3/index.json
MY_PATH\NuGetPackages\
PROJECT_PATH All projects are up-to-date for restore. 1>Done Building Project "PROJECT_PATH\PROJECT.csproj" (Restore target(s)).
Solution 1:[1]
Problem Solved:
Xunit preventing from packing the Project,
In order to pack a project with Xunit, you need to add to the csproj file the:
<IsPackable>true</IsPackable>
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | BarYaron |