Search code examples
xamarin.formsvisual-studio-2017

Xamarin build Error The "XamlCTask" task has been declared or used incorrectly


I downloaded some exercise files from LinkedIn Learning. I'm trying to build the project from the files I downloaded and I get this error message:

Error The "XamlCTask" task has been declared or used incorrectly, or failed during construction. 
Check the spelling of the task name and the assembly name. 

I have no idea what it's talking about. It also doesn't tell me much about where the error is occurring like a file name or code line so that's not very helpful. The only thing I have to go off of is that it's in the shared project. I also tried searching the entire solution for the text "XamlCTask" and it returned 0 results. What I've tried so far:

  • Clean solution
  • Rebuild solution

Any ideas on how to resolve this error?


Solution

  • Close your solution and delete the packages folder. This is a known issue/fix with "older" solutions.