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

dotnet publish can't find resource files #10541

Closed
benmccallum opened this issue Oct 10, 2019 · 3 comments
Closed

dotnet publish can't find resource files #10541

benmccallum opened this issue Oct 10, 2019 · 3 comments

Comments

@benmccallum
Copy link

In a docker container I'm trying to do a dotnet publish on one of my projects, but the build says a resource file that needs to be embedded can't be found. I've confirmed it exists (docker COPY commanding my whole source root and ls -alR says it's there too.

CSC : error CS1566: Error reading resource 'AutoGuru.GraphQL.Queries.ArticleTileQuery.ArticleTileQuery.graphql' -- 'Could not find a part of the path '/src/AutoGuru.GraphQL.Queries/src/ArticleTileQuery/ArticleTileQuery.graphql'.' [/src/AutoGuru.GraphQL.Queries/src/AutoGuru.GraphQL.Queries.csproj

Works with a VS 2019 build, so seems to be an issue with dotnet publish / MSBuild used by dotnet publish in this context.

I've taken a look at #8239 but not sure if it's 100% related.

  • This comment in the thread could be exactly what I'm experiencing, but there doesn't appear to be a solution/workaround.
  • I am on Linux, so any foldering using backslashes could be an issue, but surely I don't have to changed the .csproj EmbeddedResource references to use fwd slashes? The error seems to report the correct path too, so it'd seem that's handled.

Steps to reproduce

I may need to work up an isolated repro, but basically:

  1. Create a library with an embedded resource targeting netstandard2.0
  2. Create an app that consumes it
  3. Create a docker file based on mcr.microsoft.com/dotnet/core/sdk:2.2 that should publish the app

Expected behavior

Publish would complete.

Actual behavior

Publish fails.

Environment data

I'm inside a docker container based on the image:
mcr.microsoft.com/dotnet/core/sdk:2.2

dotnet --info output:

1>.NET Core SDK (reflecting any global.json):
1> Version:   2.2.300
1> Commit:    73efd5bd87
1>Runtime Environment:
1> OS Name:     debian
1> OS Version:  9
1> OS Platform: Linux
1> RID:         debian.9-x64
1> Base Path:   /usr/share/dotnet/sdk/2.2.300/
1>Host (useful for support):
1>  Version: 2.2.5
1>  Commit:  0a3c9209c0
1>.NET Core SDKs installed:
1>  2.2.300 [/usr/share/dotnet/sdk]
1>.NET Core runtimes installed:
1>  Microsoft.AspNetCore.All 2.2.5 [/usr/share/dotnet/shared/Microsoft.AspNetCore.All]
1>  Microsoft.AspNetCore.App 2.2.5 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
1>  Microsoft.NETCore.App 2.2.5 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
@benmccallum
Copy link
Author

Sorry, turns out the file wasn't there, was in a side-by-side directory tree... Closing.

@msftgits msftgits transferred this issue from dotnet/cli Jan 31, 2020
@boris-tarasov-maersk
Copy link

Sorry, turns out the file wasn't there, was in a side-by-side directory tree... Closing.

hi @benmccallum
could you point out where you had issue in path? My paths seems correct but still I have the issue.

@benmccallum
Copy link
Author

Sorry @boris-tarasov-maersk , this was a long time ago! I think the path to the resource file in the csproj was probably wrong. Good luck!

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

No branches or pull requests

2 participants