简体   繁体   中英

.net core project cannot load assemblies in linux docker container

I have the following issue: I have one project which loads another project using Assembly.LoadFile() . Everything works fine on windows but when i try to run it using docker it fails, saying Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly '/app/HellowWorldProject.dll'. The system cannot find the file specified. Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly '/app/HellowWorldProject.dll'. The system cannot find the file specified.

My findings are that the .dll file i'm searching for is in the same directory it is searched but something fails somewhere. On the image you can see that the file exists in /app directory in the docker container. The code i execute and the dockerfile can be found in my github: https://github.com/andre197/DebugDotNetCoreInDockerTest . Can anyone help me with that issue? 在此处输入图片说明

When you publish your project from windows to Linux containers , you should pay attention to path because in Linux based operating systems, case sensitiveness of path to file is important.
Absolutley if you have mismatch in your path to file, you got file not found error

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM