Skip to content

Instantly share code, notes, and snippets.

@benvillalobos
Last active August 25, 2022 19:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benvillalobos/2bc2dfc70cc5b331800fe11a11479aad to your computer and use it in GitHub Desktop.
Save benvillalobos/2bc2dfc70cc5b331800fe11a11479aad to your computer and use it in GitHub Desktop.
MSBuild Custom Task: Can't Find System.Memory

Custom MSBuild Task Can't Find System.Memory?

Why is this happening?

Your task is probably on .NET Core, meanwhile you're building with the net472-targeted MSBuild.exe. To fix this: either switch from using MSBuild.exe to using dotnet build, or change the TargetFramework of your task.

The long answer

Workarounds

  • Set the TargetFramework property in your task's project to net472.

OR

  • Use dotnet build <yourproj>, instead of msbuild <yourproj>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment