-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"dotnet pack" does not build #12160
Comments
any update on this? |
Hi folks, If this is still an issue, can someone provide more details? The following would be helpful:
|
Hi, @dsplaisted, I still get the same error but I've become completely disillusioned with Github Actions and will be switching to another provider, where I believe the command will "miraculously" work. So I leave it to someone else to continue the investigation. |
Hi @dsplaisted, I just tested this now on my local machine and it is still an issue. Repro steps:
The console showed the following output:
Here is the binlog of the build: If I go |
@JonathanLydall what .NET SDK are you using? On my machine dotnet pack builds with my .NET SDK 5.0.2 when I disable sdk roll farward on my global.json, perhaps you should try out the 5.0.2 SDK to see if it continues to fail and then try the .NET 6 preview SDK to see if any fixes was made. |
I would rather not install preview versions and deal with any potential issues resulting from doing so. |
@JonathanLydall no offense but testing the preview versions would let you know early if it still does not work and also lets the people maintaining the SDK know before release if it is still broken so it could be fixed. Also you should cleanup those runtimes, usually only the latest ones are used anyways no matter what the TFM you target or so I think. |
@AraHaan, with all due respect, regardless of whether or not you intended to cause offense, you nevertheless did. I politely stated my reasonable reasons for not wanting to run preview versions and I don't feel it's polite of you to presume to know my situation well enough to criticize it. Prior to my posting, I actually already had a workaround to this issue, so I don't personally need it "fixed", but nevertheless used my time to provide requested information hopefully for the benefit of all which I feel is somewhat selfless already. In regards to the older SDK versions, thanks, I had actually already thought the same thing when seeing my output earlier. |
I know this is an older issue but if someone is still having the same issue this worked for me: https://steveellwoodnlc.medium.com/error-nu5026-the-file-to-be-packed-was-not-found-on-disk-18bfbc6be4a Simply remove this from your csproj file if you have it: |
Still seems to be an issue as of: .NET SDK (reflecting any global.json): Runtime Environment: Host (useful for support): .NET SDKs installed: .NET runtimes installed: Removing the GeneratePackageOnBuild tag as mentioned does indeed allow "dotnet pack" at the CLI to build the solution first. This however seems counterintuitive to enabling that setting in the first place if one were to expect a pack as output from a build performed directly within the (VS2019) IDE. |
6.0.202, the issue is still presented.
|
That is odd, does that happen when using 6.0.300? |
Just to add some insights to this, this seems to happen when building on a linux machine. It doesn't happen when building on a Windows machine. |
I can confirm that this issue also exists on my mac running dotnet |
On my For one of every 3 or 4 packs in a row for a clean (no bin & obj) and freshly restored (VSMac dependency restore or Very first lines of the build/pack log that does not build then project for pack:
When it does build there is first build target and the pack target:
Although documentation states that it should and must build in these conditions - https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-pack#description |
I can confirm this was an issue for us on Windows. Removing the |
See dotnet/sdk#12160 (comment) I don't entirely understand what's happening here, but adding this flag indeed results into native libraries included in the archive. This should be caught by #1264 in the future
According to the documentation (https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-pack) the command
dotnet pack
should first build the project, unless the option--no-build
is specified.I am using Github Actions to publish my nuget project. And in my yml after setting up the environment and checking out the code I run the command
dotnet pack --configuration Release -o output
, which worked fine before but after my latest changes (renaming files, no changes to the yml) it fails withIf I were to place a
dotnet build
command before the packing - it works fine.The text was updated successfully, but these errors were encountered: