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

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

Closed
voroninp opened this issue Jul 25, 2023 · 4 comments · Fixed by #413
Closed
Labels
bug Something isn't working

Comments

@voroninp
Copy link

voroninp commented Jul 25, 2023

My TeamCity build definition contains dotnet pack command with --no-build modifier, and this step fails with error:

C:\Program Files\dotnet\sdk\7.0.102\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.targets(161,5): error NETSDK1085: The 'NoBuild' property was set to true but the 'Build' target was invoked.

It looks like NuGetizer tries to rebuild referenced project:

Target "ResolveProjectReferences"
22:18:47              1>Target "ResolveProjectReferences" in file "C:\Program Files\dotnet\sdk\7.0.102\Microsoft.Common.CurrentVersion.targets" from project "C:\BuildAgents\Agent03\work\9efa6ed76414e7bd\MBS.Logging.SimpleInjector\MBS.Logging.SimpleInjector.csproj" (target "ResolveReferences" depends on it):
22:18:47                Task "MSBuild" skipped, due to false condition; ('%(_MSBuildProjectReferenceExistent.BuildReference)' == 'true' and '@(ProjectReferenceWithConfiguration)' != '' and ('$(BuildingInsideVisualStudio)' == 'true' or '$(BuildProjectReferences)' != 'true') and '$(VisualStudioVersion)' != '10.0' and '@(_MSBuildProjectReferenceExistent)' != '') was evaluated as ('true' == 'true' and '..\MBS.Logging\MBS.Logging.csproj' != '' and ('false' == 'true' or 'true' != 'true') and '17.0' != '10.0' and '..\MBS.Logging\MBS.Logging.csproj' != '').
22:18:47                Task "MSBuild"
22:18:47                  Removing Properties for project "..\MBS.Logging\MBS.Logging.csproj":
22:18:47                    TargetFramework
22:18:47                    RuntimeIdentifier
22:18:47                    SelfContained
22:18:47         Project "MBS.Logging.csproj"
22:18:47              1>Done executing task "MSBuild" -- FAILED.
22:18:47              1>Done building target "ResolveProjectReferences" in project "MBS.Logging.SimpleInjector.csproj" -- FAILED.

If I remove --no-build everthing works fine.

@voroninp voroninp added the bug Something isn't working label Jul 25, 2023
@kzu
Copy link
Member

kzu commented Aug 2, 2023

Please consider sponsoring @devlooped to bump the priority on this issue. Thanks 🙏!

@voroninp
Copy link
Author

voroninp commented Aug 3, 2023

@kzu , done.

kzu added a commit that referenced this issue Aug 4, 2023
@kzu
Copy link
Member

kzu commented Aug 4, 2023

Hi @voroninp! Could you please try the PR build to verify the fix solves the issue for you?

You can install the PR package by using the https://pkg.kzu.dev/index.json and version 42.42.42-pr407. For example:

dotnet add package NuGetizer -v 42.42.1084-pr413 -s https://pkg.kzu.dev/index.json

@kzu kzu closed this as completed in #413 Aug 8, 2023
kzu added a commit that referenced this issue Aug 8, 2023
@voroninp
Copy link
Author

voroninp commented Aug 9, 2023

@kzu , I'll take a look today. Thanks

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

Successfully merging a pull request may close this issue.

2 participants