dotnet cli does not embed csdl,msl, or ssdl files
See original GitHub issueSteps to reproduce
- Add an ADO.NET entity data model to aspnet core project
- Generate a database first model (.edmx)
- Build project using visual studio 2017
- Inspect generated dll (using ILSpy or similar)
- Build project using dotnet build from cli
- Inspect generated dll
Expected behavior
Both Visual Studio and cli should embed csdl, msl, and ssdl files into dll as resources.
Actual behavior
Only Visual Studio embeds these files. When built through cli, files are not embedded and a Metadata exception is thrown when accessing the model.
Environment data
dotnet --info
output:
.NET Command Line Tools (2.1.2)
Product Information: Version: 2.1.2 Commit SHA-1 hash: 5695315371
Runtime Environment: OS Name: Windows OS Version: 10.0.15063 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\2.1.2\
Microsoft .NET Core Shared Framework Host
Version : 2.0.3 Build : a9190d4a75f4a982ae4b4fa8d1a24526566c69df
This problem only began when I moved my project from vs2015 to vs2017. I was able to use the cli just fine before.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:13 (5 by maintainers)
Top Results From Across the Web
Unable to load the specified metadata resource Release vs ...
Problem is that a dotnet cli command like dotnet publish does not embed csdl, msl, or ssdl files see issues #8932. So do...
Read more >Entity Framework - Unable to load the specified metadata ...
This worked, I assume, because the individual files (CSDL/MSL/SSDL files) were created in the output directory when it used "copy to output ...
Read more >Debug / Relase in Visual studio and missing embeded files
This works perfect in Debug mode but if you put the Project into release mode it no longer will embed the csdl, ssdl...
Read more >NET Foundation
My issue is that XML documentation files in NuGet packages are not copied to my project's build folder. I hope the distinction is...
Read more >Embedding EDM schema files in Entity Framework Beta 3
One of the new features in Entity Framework Beta3 is the ability to embed the csdl, msl and ssdl schema files into the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I believe the remaining work for this is already tracked at https://github.com/aspnet/EntityFramework6/issues/231
We currently don’t have plans to support these tools from the CLI. In this case, the workaround is to use msbuild to build your projects.
Or switch to using EF core.