aspnet-docker icon indicating copy to clipboard operation
aspnet-docker copied to clipboard

error MSB3552: Resource file "*/.resx" cannot be found

Open asterioproba opened this issue 9 years ago • 5 comments

Getting error during build:

Microsoft (R) Build Engine version 15.3.409.57025 for .NET Core Copyright (C) Microsoft Corporation. All rights reserved.

/usr/share/dotnet/sdk/2.0.0/Microsoft.Common.CurrentVersion.targets(2924,5): error MSB3552: Resource file "*/.resx" cannot be found. [/app/MyWebApi.csproj] ERROR: Service 'webapi' failed to build: The command '/bin/sh -c dotnet publish -c Release -o out' returned a non-zero code:

asterioproba avatar Sep 22 '17 18:09 asterioproba

Can you please enough information to reproduce the problem? See https://github.com/aspnet/Home/blob/dev/CONTRIBUTING.md#filing-issues

natemcmaster avatar Sep 22 '17 20:09 natemcmaster

This happens when using the Dockerimage file as per https://hub.docker.com/r/microsoft/aspnetcore-build/ Sample project: https://github.com/LeonHagenaarsKeus/MSB3552_error_sample

What works in the Angular/Angular folder:

  • dotnet build
  • dotnet publish -c Release -o out

What doesn't:

  • docker build --rm ./ -t angular:latest

running ubuntu 17.10 and dotnet version 2.0.0

LeonHagenaarsKeus avatar Oct 26 '17 09:10 LeonHagenaarsKeus

Found my error, the dockerfile.... changed WORKDIR / into WORKDIR /app on line 2

LeonHagenaarsKeus avatar Oct 26 '17 09:10 LeonHagenaarsKeus

Thanks @LeonHagenaarsKeus. Running apps in the root directory of any linux machine is likely to have issues. Putting code in a subdirectory is the best practice.

@andreybrug I'm closing this as I haven't heard back from you an a request for more info. If setting WORKDIR /app doesn't fix the issue, we can reopen and look at it again.

natemcmaster avatar Oct 26 '17 15:10 natemcmaster

Found my error, the dockerfile.... changed WORKDIR / into WORKDIR /app on line 2

This is the correct answer for those who are using the Microsoft Docker Documentation. In their example they establish the execution directory during the build env, but are not consistent in the docker runtime image.

vikasjayaswal avatar May 06 '19 16:05 vikasjayaswal