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.

dotnet cli does not embed csdl,msl, or ssdl files

See original GitHub issue

Steps 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:open
  • Created 6 years ago
  • Reactions:1
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
dasMullicommented, Jun 16, 2018

I believe the remaining work for this is already tracked at https://github.com/aspnet/EntityFramework6/issues/231

1reaction
livarcocccommented, Jun 15, 2018

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.

Read more comments on GitHub >

github_iconTop 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 >

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