Closed morissonmaciel closed 6 years ago
Does it work on Linux (without Docker)? This error is commonly caused by file casing differences since Linux has a case-sensitive file system.
Hi @natemcmaster, Thanks in advance. I don't have a pure Linux machine for this test, but I've just changed uppercase/lowercase as you mentioned in your post, and rebuilt my dotnet core image.
Surprisingly, even with filename explicit using "S" in uppercase in both Windows filesystem and Linux machine image (I used docker container cp
command to check files in container) is considering only with "s" lowercase.
I made a simple test in Startup.cs file and can confirm your point:
var all = System.IO.File.ReadAllText(System.IO.Path.Combine(env.ContentRootPath, "appsettings.json"));
Console.WriteLine(all);
The above line wrote all my appsettings.json
content without any I/O exception.
Once and again Thanks
So, your issue is fixed?
Yah @natemcmaster, for sure. Thanks a lot
Happy to help.
Hello, I'm experiencing issues running a simple aspnet core 2.0 application in a aspnet core built image using only published files.
Steps to reproduce the issue
Given following .csproj file:
Run publish command
aspnet publish -c Release -o out
Then, using following Dockerfile:
EXPOSE 80
ENTRYPOINT ["dotnet", "Api.dll"]
Unhandled Exception: System.IO.FileNotFoundException: The configuration file 'appSettings.json' was not found and is not optional. The physical path is '/app/appSettings.json'. at Microsoft.Extensions.Configuration.FileConfigurationProvider.Load(Boolean reload) at Microsoft.Extensions.Configuration.FileConfigurationProvider.Load() at Microsoft.Extensions.Configuration.ConfigurationRoot..ctor(IList`1 providers) at Microsoft.Extensions.Configuration.ConfigurationBuilder.Build() at Api.Startup..ctor(IHostingEnvironment env)
Product Information: Version: 2.1.105 Commit SHA-1 hash: 141cc8d976
Runtime Environment: OS Name: Windows OS Version: 10.0.17134 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\2.1.105\
Microsoft .NET Core Shared Framework Host
Version : 2.0.7 Build : 2d61d0b043915bc948ebf98836fefe9ba942be11
Containers: 2 Running: 0 Paused: 0 Stopped: 2 Images: 6 Server Version: 18.05.0-ce Storage Driver: aufs Root Dir: /mnt/sda1/var/lib/docker/aufs Backing Filesystem: extfs Dirs: 24 Dirperm1 Supported: true Logging Driver: json-file Cgroup Driver: cgroupfs Plugins: Volume: local Network: bridge host macvlan null overlay Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog Swarm: inactive Runtimes: runc Default Runtime: runc Init Binary: docker-init containerd version: 773c489c9c1b21a6d78b5c538cd395416ec50f88 runc version: 4fc53a81fb7c994640722ac585fa9ca548971871 init version: 949e6fa Security Options: seccomp Profile: default Kernel Version: 4.9.93-boot2docker Operating System: Boot2Docker 18.05.0-ce (TCL 8.2.1); HEAD : b5d6989 - Thu May 10 16:35:28 UTC 2018 OSType: linux Architecture: x86_64 CPUs: 1 Total Memory: 995.6MiB Name: default ID: KCFV:S3B5:35GQ:NUVW:WRHR:SWB4:FRPT:HGXW:MFPQ:2PLP:HHIN:62LL Docker Root Dir: /mnt/sda1/var/lib/docker Debug Mode (client): false Debug Mode (server): false Registry: https://index.docker.io/v1/ Labels: provider=virtualbox Experimental: false Insecure Registries: 127.0.0.0/8 Live Restore Enabled: false