The “XamlCTask” task failed unexpectedly in Xamarin

前端 未结 11 1913
孤街浪徒
孤街浪徒 2021-01-12 13:59

I am currently having a problem building my Xamarin.Forms solution. I\'m getting an error of The \"XamlCTask\" task failed unexpectedly. I tried looking at the

11条回答
  •  迷失自我
    2021-01-12 14:27

    I had 35 pages in my app with an assembly reference to turn on/off xaml compilation. To find the offending page I had to remove the assembly reference and place the following on each page and rebuild the shared project one at a time until I found the offending page (make sure you have release build selected).

    #if (DEBUG != true)
        [XamlCompilation(XamlCompilationOptions.Compile)]
    #endif
    

    Once you find the page, it's most likely a xaml issue like so many solutions above. For me it was because I had accidentally placed 2 resource dictionaries on the page so it was easy to spot, your's may not be so easy.

提交回复
热议问题