New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dotnet cli does not embed csdl,msl, or ssdl files #8932
Comments
This is not supported in the CLI. These types of files are supported in MSBuild props/targets that don't ship in the CLI and only ship in full framework VS. Have you tried using msbuild instead of dotnet build for this? |
@livarcocc Yes it does seem to work with MSBuild. What I find confusing is how I was able to run my project using 'dotnet run' on vs2015 and not get this error. Now I'm scared to publish (its an Azure Web App) as I am afraid that Azure may use dotnet build in the background and break my currently working site (haven't published since I switched), is this likely to happen? Is there some way to tell 'dotnet run' not to build the project containing my edmx file? |
I am not sure how it worked in vs2015. Do you have a project.json file that vs2015 was using? Anyways, isn't there an option for you to publish your built app, instead of have it be built in the cloud? I am sorry, don't know much about that anymore. |
@livarcocc I was able to find the old project.json in my git history, here it is:
|
I would suggest that you publish your binaries instead of relying in clould build for this case. cc @ajcvickers @divega for comments on these files not being supported in the CLI. |
@livarcocc I can describe at a high level how this works in a project with MSBuild, but I am sure your understanding of why these don't work in CLI (or if there are possible workarounds) can be better than mine:
<EntityDeploy Include="MyModel.edmx">
<Generator>EntityModelCodeGenerator</Generator>
<LastGenOutput>Model1.Designer.cs</LastGenOutput>
</EntityDeploy>
|
@livarcocc The dotnet cli should manage all this itself, perhaps calling msbuild/platform extensions as needed. This is fragmenting our CI scripts because a .sln with multiple .net framework, standard and core binaries (some multi targeted) will now be having some very ugly corner cases to handle instead of elegant In the meantime, it would REALLY help if you could at least throw a fatal exception when building with My team is strongly of the opinion that the tooling should be handling all this internally instead of passing this onto end users - that too as silent runtime failures. |
@SidShetye I agree that the dotnet cli should manage this itself especially if the build machine already has full msbuild installed. It's a consistency thing, if I can just press run from VS and it works I should be able to do the same with a cli command. |
@livarcocc what is the plan of action? As more projects migrate over this is going to frustrate users. Should be possible for dotnet to reuse current EF build tooling that works with EDMXs |
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. |
I believe the remaining work for this is already tracked at dotnet/ef6#231 |
I've done it this way while waiting for a better solution : |
Apparently no, since that's now closed, and this still remains an issue. |
Steps to reproduce
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: 5695315
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.
The text was updated successfully, but these errors were encountered: