2017-12-04 14 views
1

그래서 CentOS에서 모노를 통해 작은 콘솔 응용 프로그램을 실행하려고하지만 요구 사항의 일부로 3 개의 Visual C++ 라이브러리를 사용해야합니다. 나는 시도에 CentOS에 .NET 응용 프로그램을 실행할 때마다모노에서 MissingDLL 오류가 발생

나는

나 '(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

직접 작성한 응용 프로그램입니까? 아니면 Mono에서 실행되어야한다고 생각하는 다른 이유가 있습니까? 개인적으로 비 Windows 플랫폼 용으로 컴파일 된 VCRUNTIME140D 버전이 있었기 때문에 개인적으로는 놀랄 것입니다. 이는 일반적으로 기본 라이브러리로 배포됩니다. –

답변

0

이를 참조하십시오 Unable to use C++/CLI assembly in .NET

는 컴파일러 회귀 것 같습니다. 해당 스레드의 제안은 VS2017 15.5 미리보기 2로 업데이트하고 사라 졌는지 확인하는 것입니다.