devlooped / nugetizer

A simple to understand packing model for authoring NuGet packages
https://clarius.org/nugetizer/
MIT License
260 stars 7 forks source link

error NETSDK1085: The 'NoBuild' property was set to true but the 'Build' target was invoked #501

Closed ebugusey closed 3 months ago

ebugusey commented 5 months ago

Describe the Bug

It seems this #407 bug is not entirely fixed. Don't know if I should write there or here, because repro steps differ.

Steps to Reproduce

  1. Have project structure like this: Project1 -> Project2 -> Project3, where -> is "depends on"
  2. Project1 should be packable.
  3. Add NuGetizer to each project.
  4. Run commands:
    dotnet build
    dotnet pack --no-build --verbosity normal

Expected Behavior

Package for Project1 should be created.

Exception with Stack Trace

     1>Project "/home/user/Documents/repo/temp/ClassLibrary1/ClassLibrary1.sln" on node 1 (pack target(s)).
     1>ValidateSolutionConfiguration:
         Building solution configuration "Release|Any CPU".
     1>Project "/home/user/Documents/repo/temp/ClassLibrary1/ClassLibrary1.sln" (1) is building "/home/user/Documents/repo/temp/ClassLibrary1/Project1/Project1.csproj" (4) on node 1 (pack target(s)).
     4>Project "/home/user/Documents/repo/temp/ClassLibrary1/Project1/Project1.csproj" (4) is building "/home/user/Documents/repo/temp/ClassLibrary1/Project3/Project3.csproj" (3:3) on node 3 (default targets).
     3>/usr/share/dotnet/sdk/8.0.105/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(238,5): error NETSDK1085: The 'NoBuild' property was set to true but the 'Build' target was invoked. [/home/user/Documents/repo/temp/ClassLibrary1/Project3/Project3.csproj]
     3>Done Building Project "/home/user/Documents/repo/temp/ClassLibrary1/Project3/Project3.csproj" (default targets) -- FAILED.
     4>Done Building Project "/home/user/Documents/repo/temp/ClassLibrary1/Project1/Project1.csproj" (pack target(s)) -- FAILED.
     1>Done Building Project "/home/user/Documents/repo/temp/ClassLibrary1/ClassLibrary1.sln" (pack target(s)) -- FAILED.

Version Info

NuGetizer: 1.2.2

Additional Info

It's not reproducible when there are only one level of dependent projects, i.e. Project1 -> Project2.

kzu commented 5 months ago

Please consider sponsoring @devlooped so I can prioritize this issue 🙏