In my case, the error does not interfere with compiling the project and appears only if the MainPage.xaml file is open in the editor. Therefore, I suggest you close this file before creating your solution, and the error will disappear.
Anyway, I hope this helps.
source
share