Little intro: I am working on a .NET CORE 2 project and I need third party API which is available for C# but as I was inspecting (dotPeek) that .dll I found out that they used C++ for some functions. Environment: VS 2017 Community, .NET CORE 2 x86, IIS Express
Issue: When I add reference and build a project I don't get any error except warning (yellow exclamation mark) at reference but without explanation. When I make a request to the REST endpoint which uses class from mentioned .dll I get. Note that everything else works fine.
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 , IServiceProvider , Object[] )
at Microsoft.AspNetCore.Mvc.Controllers.ControllerActivatorProvider.<>c__DisplayClass4_0.<CreateActivator>b__0(ControllerContext controllerContext)
at Microsoft.AspNetCore.Mvc.Controllers.ControllerFactoryProvider.<>c__DisplayClass5_0.<CreateControllerFactory>g__CreateController|0(ControllerContext controllerContext)
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeInnerFilterAsync>d__14.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.<InvokeNextResourceFilter>d__22.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context)
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.<InvokeFilterPipelineAsync>d__17.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.<InvokeAsync>d__15.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
at Microsoft.AspNetCore.Builder.RouterMiddleware.<Invoke>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>d__6.MoveNext()
Application Insights Telemetry (unconfigured): {"name":"Microsoft.ApplicationInsights.Dev.Exception","time":"2018-02-23T19:15:51.4597860Z","tags":{"ai.operation.name":"POST SyncReader/Read","ai.location.ip":"127.0.0.1","ai.operation.parentId":"|7c45d3a7-496be9e5e4696c65.","ai.application.ver":"1.0.0.0","ai.internal.sdkVersion":"aspnet5c:2.1.1","ai.cloud.roleInstance":"Branko","ai.operation.id":"7c45d3a7-496be9e5e4696c65","ai.internal.nodeName":"Branko"},"data":{"baseType":"ExceptionData","baseData":{"ver":2,"properties":{"CategoryName":"Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware","DeveloperMode":"true","AspNetCoreEnvironment":"Development","{OriginalFormat}":"An unhandled exception has occurred: The type initializer for '<Module>' threw an exception.","Exception":"System.TypeInitializationException: The type initializer for '<Module>' threw an exception. ---> <CrtImplementationDetails>.ModuleLoadException: The C++ module failed to load.\n ---> System.EntryPointNotFoundException: A library name must be specified in a DllImport attribute applied to non-IJW methods.\r\n at _getFiberPtrId()\r\n at <CrtImplementationDetails>.LanguageSupport._Initialize(LanguageSupport* )\r\n at <CrtImplementationDetails>.LanguageSupport.Initialize(LanguageSupport* )\r\n --- End of inner exception stack trace ---\r\n at <CrtImplementationDetails>.ThrowModuleLoadException(String errorMessage, Exception innerException)\r\n at <CrtImplementationDetails>.LanguageSupport.Initialize(LanguageSupport* )\r\n at .cctor()\r\n --- End of inner exception stack trace ---\r\n at RFIDAppCore.Controllers.SyncReaderController..ctor()\r\n at lambda_method(Closure , IServiceProvider , Object[] )\r\n at Microsoft.AspNetCore.Mvc.Controllers.ControllerActivatorProvider.<>c__DisplayClass4_0.<CreateActivator>b__0(ControllerContext controllerContext)\r\n at Microsoft.AspNetCore.Mvc.Controllers.ControllerFactoryProvider.<>c__DisplayClass5_0.<CreateControllerFactory>g__CreateController|0(ControllerContext controllerContext)\r\n at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeInnerFilterAsync>d__14.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.GetResult()\r\n at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.<InvokeNextResourceFilter>d__22.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context)\r\n at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.<InvokeFilterPipelineAsync>d__17.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.GetResult()\r\n at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.<InvokeAsync>d__15.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.GetResult()\r\n at Microsoft.AspNetCore.Builder.RouterMiddleware.<Invoke>d__4.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.GetResult()\r\n at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>d__6.MoveNext()"},"exceptions":[{"id":3137518,"typeName":"System.TypeInitializationException","message":"An unhandled exception has occurred: The type initializer for '<Module>' threw an exception.","hasFullStack":true,"parsedStack":[{"level":0,"method":"RFIDAppCore.Controllers.SyncReaderController..ctor","assembly":"RFIDAppCore, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"},{"level":1,"method":"lambda_method","assembly":"Anonymously Hosted DynamicMethods Assembly, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"},{"level":2,"method":"Microsoft.AspNetCore.Mvc.Controllers.ControllerActivatorProvider+<>c__DisplayClass4_0.<CreateActivator>b__0","assembly":"Microsoft.AspNetCore.Mvc.Core, Version=2.0.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60"},{"level":3,"method":"Microsoft.AspNetCore.Mvc.Controllers.ControllerFactoryProvider+<>c__DisplayClass5_0.<CreateControllerFactory>g__CreateController|0","assembly":"Microsoft.AspNetCore.Mvc.Core, Version=2.0.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60"},{"level":4,"method":"Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next","assembly":"Microsoft.AspNetCore.Mvc.Core, Version=2.0.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60"},{"level":5,"method":"Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker+<InvokeInnerFilterAsync>d__14.MoveNext","assembly":"Microsoft.AspNetCore.Mvc.Core, Version=2.0.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60"},{"level":6,"method":"System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw","assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"},{"level":7,"method":"System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess","assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"},{"level":8,"method":"System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification","assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"},{"level":9,"method":"System.Runtime.CompilerServices.TaskAwaiter.GetResult","assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"},{"level":10,"method":"Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker+<InvokeNextResourceFilter>d__22.MoveNext","assembly":"Microsoft.AspNetCore.Mvc.Core, Version=2.0.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60"},{"level":11,"method":"System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw","assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"},{"level":12,"method":"Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow","assembly":"Microsoft.AspNetCore.Mvc.Core, Version=2.0.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60"},{"level":13,"method":"Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next","assembly":"Microsoft.AspNetCore.Mvc.Core, Version=2.0.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60"},{"level":14,"method":"Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker+<InvokeFilterPipelineAsync>d__17.MoveNext","assembly":"Microsoft.AspNetCore.Mvc.Core, Version=2.0.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60"},{"level":15,"method":"System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw","assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"},{"level":16,"method":"System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess","assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"},{"level":17,"method":"System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification","assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"},{"level":18,"method":"System.Runtime.CompilerServices.TaskAwaiter.GetResult","assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"},{"level":19,"method":"Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker+<InvokeAsync>d__15.MoveNext","assembly":"Microsoft.AspNetCore.Mvc.Core, Version=2.0.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60"},{"level":20,"method":"System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw","assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"},{"level":21,"method":"System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess","assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"},{"level":22,"method":"System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification","assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"},{"level":23,"method":"System.Runtime.CompilerServices.TaskAwaiter.GetResult","assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"},{"level":24,"method":"Microsoft.AspNetCore.Builder.RouterMiddleware+<Invoke>d__4.MoveNext","assembly":"Microsoft.AspNetCore.Routing, Version=2.0.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60"},{"level":25,"method":"System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw","assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"},{"level":26,"method":"System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess","assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"},{"level":27,"method":"System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification","assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"},{"level":28,"method":"System.Runtime.CompilerServices.TaskAwaiter.GetResult","assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"},{"level":29,"method":"Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware+<Invoke>d__6.MoveNext","assembly":"Microsoft.AspNetCore.Diagnostics, Version=2.0.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60"}]},{"id":48979325,"outerId":3137518,"typeName":"<CrtImplementationDetails>.ModuleLoadException","message":"The C++ module failed to load.\n","hasFullStack":true,"parsedStack":[{"level":0,"method":"<CrtImplementationDetails>.ThrowModuleLoadException","assembly":"RRU4DotNet, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"},{"level":1,"method":"<CrtImplementationDetails>.LanguageSupport.Initialize","assembly":"RRU4DotNet, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"},{"level":2,"method":".cctor","assembly":"RRU4DotNet, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"}]},{"id":295723,"outerId":48979325,"typeName":"System.EntryPointNotFoundException","message":"A library name must be specified in a DllImport attribute applied to non-IJW methods.","hasFullStack":true,"parsedStack":[{"level":0,"method":"_getFiberPtrId","assembly":"RRU4DotNet, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"},{"level":1,"method":"<CrtImplementationDetails>.LanguageSupport._Initialize","assembly":"RRU4DotNet, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"},{"level":2,"method":"<CrtImplementationDetails>.LanguageSupport.Initialize","assembly":"RRU4DotNet, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"}]}],"severityLevel":"Error"}}}
Application Insights Telemetry (unconfigured): {"name":"Microsoft.ApplicationInsights.Dev.Exception","time":"2018-02-23T19:15:51.4746127Z","tags":{"ai.operation.name":"POST SyncReader/Read","ai.location.ip":"127.0.0.1","ai.operation.parentId":"|7c45d3a7-496be9e5e4696c65.","ai.application.ver":"1.0.0.0","ai.internal.sdkVersion":"aspnet5c:2.1.1","ai.cloud.roleInstance":"Branko","ai.operation.id":"7c45d3a7-496be9e5e4696c65","ai.internal.nodeName":"Branko"},"data":{"baseType":"ExceptionData","baseData":{"ver":2,"properties":{"handledAt":"Platform","DeveloperMode":"true","AspNetCoreEnvironment":"Development"},"exceptions":[{"id":3137518,"typeName":"System.TypeInitializationException","message":"The type initializer for '<Module>' threw an exception.","hasFullStack":true,"parsedStack":[{"level":0,"method":"RFIDAppCore.Controllers.SyncReaderController..ctor","assembly":"RFIDAppCore, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"},{"level":1,"method":"lambda_method","assembly":"Anonymously Hosted DynamicMethods Assembly, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"},{"level":2,"method":"Microsoft.AspNetCore.Mvc.Controllers.ControllerActivatorProvider+<>c__DisplayClass4_0.<CreateActivator>b__0","assembly":"Microsoft.AspNetCore.Mvc.Core, Version=2.0.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60"},{"level":3,"method":"Microsoft.AspNetCore.Mvc.Controllers.ControllerFactoryProvider+<>c__DisplayClass5_0.<CreateControllerFactory>g__CreateController|0","assembly":"Microsoft.AspNetCore.Mvc.Core, Version=2.0.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60"},{"level":4,"method":"Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next","assembly":"Microsoft.AspNetCore.Mvc.Core, Version=2.0.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60"},{"level":5,"method":"Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker+<InvokeInnerFilterAsync>d__14.MoveNext","assembly":"Microsoft.AspNetCore.Mvc.Core, Version=2.0.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60"},{"level":6,"method":"System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw","assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"},{"level":7,"method":"System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess","assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"},{"level":8,"method":"System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification","assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"},{"level":9,"method":"System.Runtime.CompilerServices.TaskAwaiter.GetResult","assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"},{"level":10,"method":"Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker+<InvokeNextResourceFilter>d__22.MoveNext","assembly":"Microsoft.AspNetCore.Mvc.Core, Version=2.0.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60"},{"level":11,"method":"System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw","assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"},{"level":12,"method":"Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow","assembly":"Microsoft.AspNetCore.Mvc.Core, Version=2.0.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60"},{"level":13,"method":"Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next","assembly":"Microsoft.AspNetCore.Mvc.Core, Version=2.0.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60"},{"level":14,"method":"Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker+<InvokeFilterPipelineAsync>d__17.MoveNext","assembly":"Microsoft.AspNetCore.Mvc.Core, Version=2.0.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60"},{"level":15,"method":"System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw","assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"},{"level":16,"method":"System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess","assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"},{"level":17,"method":"System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification","assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"},{"level":18,"method":"System.Runtime.CompilerServices.TaskAwaiter.GetResult","assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"},{"level":19,"method":"Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker+<InvokeAsync>d__15.MoveNext","assembly":"Microsoft.AspNetCore.Mvc.Core, Version=2.0.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60"},{"level":20,"method":"System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw","assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"},{"level":21,"method":"System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess","assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"},{"level":22,"method":"System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification","assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"},{"level":23,"method":"System.Runtime.CompilerServices.TaskAwaiter.GetResult","assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"},{"level":24,"method":"Microsoft.AspNetCore.Builder.RouterMiddleware+<Invoke>d__4.MoveNext","assembly":"Microsoft.AspNetCore.Routing, Version=2.0.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60"},{"level":25,"method":"System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw","assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"},{"level":26,"method":"System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess","assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"},{"level":27,"method":"System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification","assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"},{"level":28,"method":"System.Runtime.CompilerServices.TaskAwaiter.GetResult","assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"},{"level":29,"method":"Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware+<Invoke>d__6.MoveNext","assembly":"Microsoft.AspNetCore.Diagnostics, Version=2.0.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60"}]},{"id":48979325,"outerId":3137518,"typeName":"<CrtImplementationDetails>.ModuleLoadException","message":"The C++ module failed to load.\n","hasFullStack":true,"parsedStack":[{"level":0,"method":"<CrtImplementationDetails>.ThrowModuleLoadException","assembly":"RRU4DotNet, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"},{"level":1,"method":"<CrtImplementationDetails>.LanguageSupport.Initialize","assembly":"RRU4DotNet, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"},{"level":2,"method":".cctor","assembly":"RRU4DotNet, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"}]},{"id":295723,"outerId":48979325,"typeName":"System.EntryPointNotFoundException","message":"A library name must be specified in a DllImport attribute applied to non-IJW methods.","hasFullStack":true,"parsedStack":[{"level":0,"method":"_getFiberPtrId","assembly":"RRU4DotNet, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"},{"level":1,"method":"<CrtImplementationDetails>.LanguageSupport._Initialize","assembly":"RRU4DotNet, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"},{"level":2,"method":"<CrtImplementationDetails>.LanguageSupport.Initialize","assembly":"RRU4DotNet, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"}]}]}}}
Microsoft.AspNetCore.Hosting.Internal.WebHost:Information: Request finished in 237.6182ms 500
Application Insights Telemetry (unconfigured): {"name":"Microsoft.ApplicationInsights.Dev.Message","time":"2018-02-23T19:15:51.4883628Z","tags":{"ai.operation.name":"POST SyncReader/Read","ai.location.ip":"127.0.0.1","ai.operation.parentId":"|7c45d3a7-496be9e5e4696c65.","ai.application.ver":"1.0.0.0","ai.internal.sdkVersion":"aspnet5c:2.1.1","ai.cloud.roleInstance":"Branko","ai.operation.id":"7c45d3a7-496be9e5e4696c65","ai.internal.nodeName":"Branko"},"data":{"baseType":"MessageData","baseData":{"ver":2,"message":"Request finished in 237.6182ms 500","severityLevel":"Information","properties":{"CategoryName":"Microsoft.AspNetCore.Hosting.Internal.WebHost","StatusCode":"500","DeveloperMode":"true","AspNetCoreEnvironment":"Development","ElapsedMilliseconds":"237.6182"}}}}
Application Insights Telemetry (unconfigured): {"name":"Microsoft.ApplicationInsights.Dev.Request","time":"2018-02-23T19:15:51.2476880Z","tags":{"ai.operation.name":"POST SyncReader/Read","ai.location.ip":"127.0.0.1","ai.application.ver":"1.0.0.0","ai.internal.sdkVersion":"aspnet5c:2.1.1","ai.cloud.roleInstance":"Branko","ai.operation.id":"7c45d3a7-496be9e5e4696c65","ai.internal.nodeName":"Branko"},"data":{"baseType":"RequestData","baseData":{"ver":2,"id":"|7c45d3a7-496be9e5e4696c65.","name":"POST SyncReader/Read","duration":"00:00:00.2439082","success":false,"responseCode":"500","url":"http://localhost:52295/api/SyncReader","properties":{"DeveloperMode":"true","AspNetCoreEnvironment":"Development","httpMethod":"POST"}}}}
I've googled a lot about this and could not find any solution that fits my case.
TL;DR I would need some kind of explanation on how to include .dll which has C++ code in but it is mostly written in C#.
Thanks stackoverflow
.NET Core does not (yet) support C++/CLI ("Managed C++") and will fail to load such libraries. It is a planned feature for .NET Core 3.0.
See this GitHub issue for more details.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With