Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Duplicate 'EmbeddedResource' items were included after migrate to .NET Standard?

Using VS 2017 15.4.0

Following James Montemagno "Upgrading to Xamarin.Forms to .NET Standard"

https://channel9.msdn.com/Shows/XamarinShow/Snack-Pack-15-Upgrading-to-XamarinForms-to-NET-Standard?ocid=player

When trying to Clean/Build I am receiving the error:

Severity Code Description Project File Line Suppression State Error Duplicate 'EmbeddedResource' items were included. The .NET SDK includes 'EmbeddedResource' items from your project directory by default. You can either remove these items from your project file, or set the 'EnableDefaultEmbeddedResourceItems' property to 'false' if you want to explicitly include them in your project file. For more information, see https://aka.ms/sdkimplicititems. The duplicate items were: 'App.xaml'; 'MainPage.xaml' App5.core C:\Program Files\dotnet\sdk\2.0.2\Sdks\Microsoft.NET.Sdk\build\Microsoft.NET.Sdk.DefaultItems.targets 274

Any solution please?

like image 594
AG70 Avatar asked Oct 14 '17 20:10

AG70


Video Answer


2 Answers

It happened to me in MS Visual Studio for Mac after I have added two font files as embedded resources.

These files were titled with the same prefix (Lora-Regular.ttf & Lora-Bold.ttf) and it looks like my IDE did handle this in a bad way.

Indeed, the following weird line was inserted in my .csproj file :

<EmbeddedResource Include="**/*" />

All I did was removing this line and error disapeared.

like image 99
Kapusch Avatar answered Sep 21 '22 08:09

Kapusch


My mistake was that I added embedded resource while simulator with app was running.

Soo... I had THIS added automatically inside .csproj file:

<EmbeddedResource Include="**/*" />

Remove it, and then everything should be fine

like image 44
idchlife Avatar answered Sep 18 '22 08:09

idchlife