小编use*_*457的帖子

带有C++代码运行时错误的.NET Core 2 DLL参考

小介绍:我正在开发一个.NET CORE 2项目,我需要第三方API,它可用于C#,但正如我正在检查(dotPeek)那样.dll我发现他们使用C++来实现某些功能.环境:VS 2017社区,.NET CORE 2 x86,IIS Express

问题:当我添加引用并构建项目时,除了警告(黄色感叹号)之外我没有收到任何错误但没有解释.当我向使用上述.dll中的类的REST端点发出请求时,我得到了.请注意,其他一切正常.

    System.TypeInitializationException: The type initializer for '<Module>' threw an exception. ---> <CrtImplementationDetails>.ModuleLoadException: The C++ module failed to load.
 ---> System.EntryPointNotFoundException: A library name must be specified in a DllImport attribute applied to non-IJW methods.
   at _getFiberPtrId()
   at <CrtImplementationDetails>.LanguageSupport._Initialize(LanguageSupport* )
   at <CrtImplementationDetails>.LanguageSupport.Initialize(LanguageSupport* )
   --- End of inner exception stack trace ---
   at <CrtImplementationDetails>.ThrowModuleLoadException(String errorMessage, Exception innerException)
   at <CrtImplementationDetails>.LanguageSupport.Initialize(LanguageSupport* )
   at .cctor()
   --- End of inner exception stack trace ---
   at RFIDAppCore.Controllers.SyncReaderController..ctor()
   at lambda_method(Closure …
Run Code Online (Sandbox Code Playgroud)

.net c# c++ visual-studio .net-core

4
推荐指数
1
解决办法
1821
查看次数

标签 统计

.net ×1

.net-core ×1

c# ×1

c++ ×1

visual-studio ×1