I have a Xamarin.Forms project and I drag and drop an image into my Android resource folder, then I copied and pasted it into my UWP project, but the image is not displayed, so I changed its Build Action to Content, but The error is displayed:
Error The item "obj\Debug\MainPage.xaml.g.cs" was specified more than once in the "Sources" parameter. Duplicate items are not supported by the "Sources" parameter. XamaTask.Android
I am not sure if it is related to the images, but after duplicating, renaming and changing that property of Build Action the error started to show, I also deleted the images and changed the name several times and checked my Android.csproject but I did not find any duplicates. Edit I found the file that has the error, but once again, I can not find any duplicate, here is the code:
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
[assembly: global::Xamarin.Forms.Xaml.XamlResourceIdAttribute("XamaTask.Droid.MainPage.xaml", "MainPage.xaml", typeof(global::XamaTask.MainPage))]
namespace XamaTask {
[global::Xamarin.Forms.Xaml.XamlFilePathAttribute("C:\Users\M\source\repos\XamaTask\XamaTask\XamaTask\MainPage.xaml")]
public partial class MainPage : global::Xamarin.Forms.ContentPage {
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Forms.Build.Tasks.XamlG", "2.0.0.0")]
private void InitializeComponent() {
global::Xamarin.Forms.Xaml.Extensions.LoadFromXaml(this, typeof(MainPage));
}
}
}