[英]Won't run .exe correctly on Windows Server
I'm trying to run a Console Application on Windows Server 2019 (x64). 我正在尝试在Windows Server 2019(x64)上运行控制台应用程序。 After i run .exe on the server then writes the following error: 在服务器上运行.exe之后,出现以下错误:
Could not load or assembly 'MySql.Data' 无法加载或汇编“ MySql.Data”
..etc for all dependencies. ..etc的所有依赖项。
I tried to run just the .exe file (i didn't copy the whole Release directory) on a few PC and it is working well. 我试图在几台PC上仅运行.exe文件(我没有复制整个Release目录),并且运行良好。 All of them Win 64bit. 他们都赢得了64位。 On the server, .exe only work if i copy the whole /Release directory. 在服务器上,.exe仅在我复制整个/ Release目录时才有效。
I also build and release app with 'Any Cpu' option. 我还使用“任何Cpu”选项构建和发布应用。
Any tip why i need to copy the whole /bin/release directory to run .exe? 为什么我需要复制整个/ bin / release目录才能运行.exe? Why not enough just the .exe file? 为什么.exe文件不够?
Many thanks! 非常感谢!
The exe file doesn't contain the used dlls, just references to the dlls. exe文件不包含使用的dll,仅包含对dll的引用。 That's why they are in the release directory and the reason you need to copy the whole directory. 这就是它们位于发布目录中的原因,也是您需要复制整个目录的原因。
Kind regards Bernd 亲切的问候伯恩德
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.