在Mono中获取MissingDLL错误

问题描述 投票:1回答:1

所以我试图在CentOS上通过mono运行一个小型控制台应用程序,但我需要使用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上运行有任何想法?

c# .net visual-c++ mono centos
1个回答
0
投票

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

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

© www.soinside.com 2019 - 2024. All rights reserved.