question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

EntityDeploy with local edmx file causes duplicate resource errors only from command line build

See original GitHub issue

With EF 6.3 installed, when using SDK-based projects, edmx files are added automatically with the EntityDeploy task.

If I explicitly add a local edmx like this:

  <ItemGroup>
    <EntityDeploy Include="Entities.edmx" />
  </ItemGroup>

I would expect this to work too. An indeed, this seems to cause the expected outcome when building the project from Visual Studio. However, when I build from the command line, for example with dotnet build project.csproj, I get the following error:

C:\Program Files\dotnet\sdk\3.0.100-preview9-013951\Roslyn\Microsoft.CSharp.Core.targets(59,5): error MSB3083: The item “obj\Debug\netcoreapp3.0\edmxResourcesToEmbed\Entities.csdl” was specified more than once in the “Resources” parameter and both items had the same value “Entities.csdl” for the “LogicalName” metadata. Duplicate items are not supported by the “Resources” parameter unless they have different values for the “LogicalName” metadata. [c:\Users\divega\source\repos\EF6DotNetCoreApp\EF6DotNetCoreApp.csproj]

cc @bricelam, @ajcvickers

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
ajcvickerscommented, Oct 9, 2019

@JohanOtto There should be no need to change anything to “Code First”. If the workaround is not working for you, then please provide full details.

1reaction
bricelamcommented, Sep 30, 2019

@JohanOtto Set this in your csproj if you want to explicitly include them:

<PropertyGroup>
  <EnableDefaultEntityDeployItems>False</EnableDefaultEntityDeployItems>
</PropertyGroup>
Read more comments on GitHub >

github_iconTop Results From Across the Web

EntityDeploy with local edmx file causes duplicate resource ...
If I explicitly add a local edmx like this: I would ex... ... edmx file causes duplicate resource errors only from command line...
Read more >
Entity Framework updating edmx creates duplicate properties
1 Answer 1 ... It is probably that the EF model has become confused (corrupted) after the keys were added. A many-to-many table...
Read more >
Announcing Entity Framework Core 3.0 Preview 9 and ...
NET Core project within Solution Explorer may cause hangs, so it is better to copy the files from the command line.
Read more >
Web.config and Entity Framework Transformation Process
The Visual Studio IDE allows you to create transformation files for any XML-based resource file in the project.
Read more >
Unable to load the specified metadata resource-Entity ...
Coding example for the question System.Data.MetadataException: Unable to load the specified metadata resource-Entity Framework.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found