Skip to content
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

Not Respecting "Generate NuGet package on build" #22

Closed
Noggog opened this issue Oct 22, 2020 · 10 comments
Closed

Not Respecting "Generate NuGet package on build" #22

Noggog opened this issue Oct 22, 2020 · 10 comments
Labels
bug Something isn't working

Comments

@Noggog
Copy link

Noggog commented Oct 22, 2020

First off, just wanted to say thanks for the help over in issue devlooped/GitInfo#134

When swapping over to Nugetizer, it was able to solve the issue of parent library versioning stamps, but I'm now noticing that it doesn't seem to be respecting my Project Settings -> Package -> "Generate NuGet package on build" setting.

Is this something that Nugetizer could be adjusted to respect and fulfill?

@kzu
Copy link
Member

kzu commented Oct 22, 2020

Hi @Noggog, glad to see you over here too!

This is a very nice catch/bug you uncovered, thanks! Turns out that the compatibility properties are defined in a .props file (see https://github.com/kzu/nugetizer/blob/9f35e172668e1ddf05c12dada190fdac751132d7/src/NuGetizer.Tasks/NuGetizer.Compatibility.props#L18) but props are imported at the top of your project, when your custom properties aren't still available. I'll move that to targets 👍

@kzu kzu added the bug Something isn't working label Oct 22, 2020
@kzu
Copy link
Member

kzu commented Oct 22, 2020

Hm, actually, it's imported from targets: https://github.com/kzu/nugetizer/blob/292b2c1e9e54b9615f5a1fd4f27c62fd558388a2/src/NuGetizer.Tasks/NuGetizer.targets#L18

Could you run a build with /bl from cmdline and attach it here? (make sure it doesn't have sensitive information, it's best to do it with a repro project).

Thanks!

@kzu kzu added need info and removed bug Something isn't working labels Oct 22, 2020
@Noggog
Copy link
Author

Noggog commented Oct 22, 2020

Hmm, something weird is going on. Both from Visual Studio and command line (dotnet build /bl) I see that it thinks it's creating packages:

Microsoft (R) Build Engine version 16.7.0+7fb82e5b2 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

C:\Program Files\dotnet\sdk\3.1.403\MSBuild.dll -consoleloggerparameters:Summary -distributedlogger:Microsoft.DotNet.Tools.MSBuild.MSBuildLogger,C:\Program Files\dotnet\sdk\3.1.403\dotnet.dll*Microsoft.DotNet.Tools.MSBuild.MSBuildForwardingLogger,C:\Program Files\dotnet\sdk\3.1.403\dotnet.dll -maxcpucount -restore -verbosity:m /bl .\GitInfoTests.sln
  Determining projects to restore...
  All projects are up-to-date for restore.
  ParentLibrary -> C:\Repos\GitInfoTests\ParentLibrary\bin\Debug\netstandard2.0\ParentLibrary.dll
  Created package at C:\Repos\GitInfoTests\ParentLibrary\bin\Debug\ParentLibrary.0.5.5.1-dev.nupkg.
  GitInfoTests -> C:\Repos\GitInfoTests\GitInfoTests\bin\Debug\netstandard2.0\GitInfoTests.dll
  Created package at C:\Repos\GitInfoTests\GitInfoTests\bin\Debug\GitInfoTests.0.5.5.1-dev.nupkg.

But they aren't there when I go look
image

Maybe they are being made, but then just cleaned up and deleted right after for somehow?

I'm just using my example repo from before:
https://github.com/Noggog/GitInfoTests

@kzu
Copy link
Member

kzu commented Oct 25, 2020

image

cloned, run msbuild -r and I did get the package. Opened the file and it has the right stuff in there and everything 😕

@Noggog
Copy link
Author

Noggog commented Oct 26, 2020

Hmm, I've been running dotnet build not any msbuild. Might that be a difference that matters?

This is my overall behavior. You can see my dotnet build has no output, but dotnet pack does.

https://i.imgur.com/LMNn5iL.mp4

I cloned to a 2nd machine (my laptop) and got the same behavior.

Additionally, I made the changes we did to the GitInfoTests repo to one of my other projects, and had some strange behavior. The presence of Nugetizer made the "Package" option in the project panel disappear entirely. Removing Nugetizer brings it back, This behavior hasn't occurred in GitInfoTests yet that I've seen.

https://i.imgur.com/GnAKziw.mp4

@kzu
Copy link
Member

kzu commented Oct 29, 2020

Without binlogs, it's really hard to know what's going on.

@kzu
Copy link
Member

kzu commented Oct 29, 2020

a-ha, the binlog reveals the issue indeed 👍

image

Seems like a bug I introduced with the output cleanup. For now you can workaround it by setting EnablePackCleanup=false in your project.

@kzu kzu added bug Something isn't working and removed need info labels Oct 29, 2020
@kzu kzu closed this as completed in 0ab59f7 Oct 29, 2020
@kzu
Copy link
Member

kzu commented Oct 29, 2020

ok, was a bug, here's a binlog where it's fixed now :)
msbuild.zip

@Noggog
Copy link
Author

Noggog commented Oct 30, 2020

Heyyy! Got things working! Thanks for the help investigating

@kzu
Copy link
Member

kzu commented Oct 31, 2020

Thanks for uncovering the bug and helping verify the fix! 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants