Open JuanDouglas opened 1 month ago
In your current workaround, you create the pt-BR
folder; but does the runtime then load the resource DLL from that folder or does it look in the pt-br
folder only?
@KalleOlaviNiemitalo, sorry, the error does not occur at runtime but rather at publish time. Unfortunately, I have not been able to test the project in question within the environment to confirm, but I believe the reference is being loaded.
What makes it a bit strange is that no error occurs during the build (I was able to test the reference in the build, and it is working as it should).
Description
When publishing an ASP.NET application in a Docker environment on Linux, there is a conflict between the
pt-BR
andpt-br
folders. Dotnet automatically generates a folder namedpt-br
(lowercase), which is used by ASP.NET to locate language-specific libraries. However, when trying to copy the libraries during the publish process, dotnet assumes that thept-BR
(uppercase) folder has already been created, resulting in an error since Linux distinguishes between uppercase and lowercase in directory names.This issue prevents the libraries from being copied to the correct folder, causing the publish process to fail.
Steps to reproduce:
pt-BR
folder.pt-BR
folder.Expected behavior:
Dotnet should correctly differentiate between the
pt-BR
andpt-br
folders in the Linux environment, creating or using the correct folder as expected by ASP.NET, without confusing the two directories.Actual behavior:
Dotnet detects that the
pt-br
folder was created and assumes that thept-BR
folder already exists. However, since Linux differentiates between uppercase and lowercase in directory names, thept-BR
folder was not created, causing an error when trying to copy the files to that directory.Error message:
The error message indicates that part of the copy directory has not been created yet, which is why the file copy operation was not completed.
/usr/share/dotnet/sdk/8.0.402/Sdks /Microsoft.NET.Sdk/targets/Microsoft.NET.Publish.targets(351,5): error MSB3021: Unable to copy file "/root/.nuget/packages/packagename/1.0.6.1/lib/net8.0/pt-BR/packagename.resources.dll" to "/app/publish/pt-BR/packagename.resources.dll". Could not find a part of the path '/app/publish/pt-BR/packagename.resources.dll'. [/app/project/project/project.csproj]
Environment:
Operating System: Linux (Docker container mcr.microsoft.com/dotnet/sdk:8.0) Framework: .NET 8.0 ASP.NET Core 8.0 Docker version: 20.x.x
Possible solution:
A possible solution would be to adjust the publish process so that dotnet correctly creates or checks for the existence of resource folders, taking into account the case sensitivity of directory names on Linux file systems.
Current workaround:
As a temporary solution, the
pt-BR
folder can be manually created before publishing. However, this is not ideal for automated CI/CD pipelines.