I have managed to rebuild the project by remove the line DebugType = "$(DebugType)"
in the xml file below. What does this line really do and why it can fix my problem. I have the error because I pulling the new code from source tree.
<Target Name="XamlC">
<XamlCTask
Assembly = "$(IntermediateOutputPath)$(TargetFileName)"
ReferencePath = "@(ReferencePath)"
Verbosity = "2"
OptimizeIL = "true"
DebugSymbols = "$(DebugSymbols)"
/>
</Target>