Skip to content
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

Inclusion of edmxResourcesToEmbed fails build in linux due to path slash #1434

Closed
joebone opened this issue Oct 31, 2019 · 4 comments
Closed

Comments

@joebone
Copy link

joebone commented Oct 31, 2019

[ Might be a duplicate of #1378 , but that is marked as closed and fixed, and at least as far as I am aware, it is not ( or at least hasn't been released ) ]

When building a project that contains edmx files in linux (alpine docker in this case), the build fails.
It seems to be because the backslash is hardcoded when generated, but is not read the same way when building.

Steps to reproduce

Have a netcoreapp3.0 project, include an edmx, and build it.

Further technical details

Output of failed build:

/src/HGRLibraryCommon # dotnet build -c Release -nowarn:"VSTHRD200;NU1701"
Microsoft (R) Build Engine version 16.3.0+0f4c62fea for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  Restore completed in 22.63 ms for /src/xxx/xxx.csproj.
CSC : error CS1566: Error reading resource 'Model.asd.csdl' -- 'Could not find file '/src/xxx/obj/Release/netcoreapp3.0/edmxResourcesToEmbed/Model/asd.csdl'.' [/src/xxx/xxx.csproj]

Build FAILED.

CSC : error CS1566: Error reading resource 'Model.asd.csdl' -- 'Could not find file '/src/xxx/obj/Release/netcoreapp3.0/edmxResourcesToEmbed/Model/asd.csdl'.' [/src/xxx/xxx.csproj]
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:01.50

however, the files DO exist, BUT because the backslash is hardcoded, "Model" hasn't been generated as a folder, so we have files named "Model\asd.csdl" in the parent folder:

/src/xxx # find . -name "*.csdl"
./obj/Debug/netcoreapp3.0/edmxResourcesToEmbed/Model\asd.csdl
./obj/Release/netcoreapp3.0/edmxResourcesToEmbed/Model\asd.csdl
/src/xxx # cd obj/Debug/netcoreapp3.0/edmxResourcesToEmbed/
/src/xxx/obj/Debug/netcoreapp3.0/edmxResourcesToEmbed # ls -la
total 288
drwxr-xr-x    4 root     root          4096 Oct 31 11:07 .
drwxr-xr-x    3 root     root          4096 Oct 31 11:07 ..
drwxr-xr-x    2 root     root          4096 Oct 31 11:07 Model
-rw-r--r--    1 root     root        106576 Oct 31 11:07 Model\asd.csdl
-rw-r--r--    1 root     root         56320 Oct 31 11:07 Model\asd.msl
-rw-r--r--    1 root     root         84500 Oct 31 11:07 Model\asd.ssdl
/src/xxx/obj/Debug/netcoreapp3.0/edmxResourcesToEmbed #
@ajcvickers
Copy link
Member

@joebone What EF package version are you using?

@husseinraoouf
Copy link

I can confirm this issue happens to me
i am using ef 6.3 and .net core 3.0

@joebone
Copy link
Author

joebone commented Nov 6, 2019

@ajcvickers sorry, didnt get a notification, was using the standard release non-preview NuGet 6.3.0

In the end as a workaround, we changed the library dependency to generate a nuget package and imported that when building in docker, but evidently its not ideal.

@ajcvickers
Copy link
Member

Duplicate of #1378 which is in the 6.4 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants