2017-12-04 11 views
1

CentOS上でmonoを使用して小さなコンソールアプリケーションを実行しようとしていますが、要件の一部として3つのVisual C++ライブラリを使用する必要があります。私がしようとするとCentOSの上の.NETアプリケーションを実行するたびにMonoでMissingDLLエラーが発生する

は私が

I」は(C/C++ vs2015での.NETアセンブリ私が学んださ)が欠落していることvsruntime140d.dllを理由に例外を取得します私のC++アプリケーションを/ clr:safeに設定し、Windows SDKのバージョンをWin10に設定し、Platform ToolsetをVS 2017に設定しました(これは実行しましたが、2015も試しました)。リンカでは、私は窓その後、CentOSのに上のバイナリおよびアセンブリをコピーし、その後モノApplication.exeを実行中に、これらのアプリケーションを構築しようとした

ライブラリ/ NODEFAULTLIBデフォルト無視するように設定しましたが、それは

を返します。 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上で実行する方法については誰にも分かりますか?

+0

LinuxでVisualC++ dllを使用することはできません。移植性がありません。ネイティブC関数を使用する必要がある場合は、それをプレーンCまたはC++で記述し、それを使用する各プラットフォームでコンパイルする必要があります。 – Gusman

+0

CentOS向けにこれらのC++ライブラリを(クロス)コンパイルする必要があります – SushiHangover

+0

これは自分で作成したアプリケーションですか?それとも、モノで動くべきだと思う他の理由がありますか?個人的には、Windows以外のプラットフォーム用にコンパイルされたバージョンのVCRUNTIME140Dがありました。これは、通常はネイティブライブラリとして配布されています。 –

答えて

0

はこれを参照してください。Unable to use C++/CLI assembly in .NET

は、コンパイラ回帰のように見えます。 そのスレッドの提案は、VS2017 15.5プレビュー2に更新し、それがなくなったかどうかを確認することです。

関連する問題