EntityDeploy with local edmx file causes duplicate resource errors only from command line build
See original GitHub issueWith 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:
- Created 4 years ago
- Comments:7 (5 by maintainers)
@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.
@JohanOtto Set this in your csproj if you want to explicitly include them: