dotnet / pinvoke

A library containing all P/Invoke code so you don't have to import it every time. Maintained and updated to support the latest Windows OS.
MIT License
2.12k stars 222 forks source link

GetCurrentThreadId will faill on some machines where it missing from api-ms-win-core-processthreads-l1-1-1.dll #358

Closed garg0v closed 4 years ago

garg0v commented 6 years ago

I am trying to use GetCurrentThreadId() but on some machines I get : (ERROR) Unexpected exception has occurred System.EntryPointNotFoundException: Unable to find an entry point named 'GetCurrentThreadId' in DLL 'api-ms-win-core-processthreads-l1-1-1.dll'. caught here: PInvoke.Kernel32.GetCurrentThreadId() Is there a reason for using that library instead of kernel32.dll?

AArnott commented 6 years ago

We use the "API Sets" DLLs as required to work in Store apps, when the apps are targeting store-compatible profiles. What version of Windows are you using? What version of PInvoke are you using? What is the target platform of your app, and the target platform of the library that references PInvoke? Which PInvoke.Kernel32.dll within the nuget package is your app shipping?

AArnott commented 4 years ago

Closing due to no response.