gpt4 book ai didi

c# - 在 Mono 中获取 MissingDLL 错误

转载 作者:太空宇宙 更新时间:2023-11-03 17:23:28 24 4
gpt4 key购买 nike

所以我想在 CentOS 上通过单声道运行一个小型控制台应用程序,但我需要使用 3 个 Visual-C++ 库作为要求的一部分。

每当我尝试在 CentOS 上运行 .net 应用程序时,我都会收到一个异常,指出缺少 vsruntime140d.dll(我了解到这是 vs2015 中用于 c/c++ 的 .net 程序集)

我已将我的 C++ 应用程序配置为/clr:safe,将其 Windows SDK 版本设置为 Win10,并将其平台工具集设置为 VS 2017(我已运行,但我也尝试过 2015)。在链接器中,我将其设置为 Ignore Default Libraries/NODEFAULTLIB

我试过在 Windows 中构建这些应用程序,然后将二进制文件和程序集复制到 centos,然后运行 ​​mono Application.exe 但它返回

Unhandled Exception:
System.TypeInitializationException: The type initializer for '<Module>' threw an exception. ---> <CrtImplementationDetails>.ModuleLoadException: The C++ module failed to load during appdomain initialization.
---> System.DllNotFoundException: VCRUNTIME140D.dll
at (wrapper managed-to-native) System.Runtime.InteropServices.Marshal:Prelink (System.Reflection.MethodInfo)
at <Module>.<CrtImplementationDetails>.LanguageSupport.ForceLoadRuntimeApis (<CrtImplementationDetails>.LanguageSupport* ) [0x00093] in <10c169d804e4480ab7903a570bc3de2b>:0
at <Module>.<CrtImplementationDetails>.LanguageSupport.InitializePerAppDomain (<CrtImplementationDetails>.LanguageSupport* ) [0x00012] in <10c169d804e4480ab7903a570bc3de2b>:0
at <Module>.<CrtImplementationDetails>.LanguageSupport._Initialize (<CrtImplementationDetails>.LanguageSupport* ) [0x00015] in <10c169d804e4480ab7903a570bc3de2b>:0
at <Module>.<CrtImplementationDetails>.LanguageSupport.Initialize (<CrtImplementationDetails>.LanguageSupport* ) [0x00010] in <10c169d804e4480ab7903a570bc3de2b>:0
--- End of inner exception stack trace ---
at <Module>.<CrtImplementationDetails>.ThrowModuleLoadException (System.String errorMessage, System.Exception innerException) [0x00007] in <10c169d804e4480ab7903a570bc3de2b>:0
at <Module>.<CrtImplementationDetails>.LanguageSupport.Initialize (<CrtImplementationDetails>.LanguageSupport* ) [0x00026] in <10c169d804e4480ab7903a570bc3de2b>:0
at <Module>..cctor () [0x00008] in <10c169d804e4480ab7903a570bc3de2b>:0
--- End of inner exception stack trace ---
at Application.Program.Main () [0x00029] in <2ff592459ad74d828ffa904fe73703f3>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: The type initializer for '<Module>' threw an exception. ---> <CrtImplementationDetails>.ModuleLoadException: The C++ module failed to load during appdomain initialization.
---> System.DllNotFoundException: VCRUNTIME140D.dll
at (wrapper managed-to-native) System.Runtime.InteropServices.Marshal:Prelink (System.Reflection.MethodInfo)
at <Module>.<CrtImplementationDetails>.LanguageSupport.ForceLoadRuntimeApis (<CrtImplementationDetails>.LanguageSupport* ) [0x00093] in <10c169d804e4480ab7903a570bc3de2b>:0
at <Module>.<CrtImplementationDetails>.LanguageSupport.InitializePerAppDomain (<CrtImplementationDetails>.LanguageSupport* ) [0x00012] in <10c169d804e4480ab7903a570bc3de2b>:0
at <Module>.<CrtImplementationDetails>.LanguageSupport._Initialize (<CrtImplementationDetails>.LanguageSupport* ) [0x00015] in <10c169d804e4480ab7903a570bc3de2b>:0
at <Module>.<CrtImplementationDetails>.LanguageSupport.Initialize (<CrtImplementationDetails>.LanguageSupport* ) [0x00010] in <10c169d804e4480ab7903a570bc3de2b>:0
--- End of inner exception stack trace ---
at <Module>.<CrtImplementationDetails>.ThrowModuleLoadException (System.String errorMessage, System.Exception innerException) [0x00007] in <10c169d804e4480ab7903a570bc3de2b>:0
at <Module>.<CrtImplementationDetails>.LanguageSupport.Initialize (<CrtImplementationDetails>.LanguageSupport* ) [0x00026] in <10c169d804e4480ab7903a570bc3de2b>:0
at <Module>..cctor () [0x00008] in <10c169d804e4480ab7903a570bc3de2b>:0
--- End of inner exception stack trace ---
at Application.Program.Main () [0x00029] in <2ff592459ad74d828ffa904fe73703f3>:0

有没有人对如何让这个应用程序在 CentOS 上运行有任何想法?

最佳答案

看到这个:Unable to use C++/CLI assembly in .NET

看起来像是编译器回归。该线程中的建议是更新到 VS2017 15.5 预览版 2,看看它是否消失了。

关于c# - 在 Mono 中获取 MissingDLL 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47641258/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com