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

msbuild/custom-task-code-generation sample fails when called with dotnet pack --no-build #6721

Closed
2 of 3 tasks
StudioLE opened this issue Mar 4, 2024 · 1 comment
Closed
2 of 3 tasks

Comments

@StudioLE
Copy link

StudioLE commented Mar 4, 2024

Issue description

When dotnet pack --no-build is called on the msbuild/custom-task-code-generation sample it fails with:

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

The issue is caused by line 198:

<Target Name="CopyProjectReferencesToPackage" DependsOnTargets="ResolveReferences">

DependsOnTargets="ResolveReferences" is forcing a build.

Target framework

Check the .NET target framework(s) being used, and include the version number(s).

  • .NET Core
  • .NET Framework
  • .NET Standard

Executed on GitHub Actions runner so ``dotnet --info` unknown.

@StudioLE
Copy link
Author

StudioLE commented Mar 5, 2024

Closing as this isn't an issue with the sample itself.

The issue was I adapted the sample with a <ProjectReference ... /> and the error was being thrown from that project.

I was able to resolve this with: <ProjectReference ... GlobalPropertiesToRemove="NoBuild" />

@StudioLE StudioLE closed this as completed Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant