debugging our script fails as soon as it loads a DLL

Use this forum to ask questions after your subscription maintenance expires or before you buy. Need information on licensing or pricing? Questions about a trial version? This is the right place for you. No scripting questions, please.
Forum rules
DO NOT ANY LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.
This topic is 4 months and 1 week old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
cepickalad
Posts: 5
Last visit: Tue Feb 24, 2026 2:50 am
Answers: 0

debugging our script fails as soon as it loads a DLL

Post by cepickalad »

Hello,
debugging our script fails as soon as it loads a DLL (LoadLibrary) and calls a function from it.
We see errors and cannot proceed with debugging. Without the DLL, debugging works.

Is this supported in
Product: PowerShell Studio 2025 (64 Bit)
Build: v5.9.262
OS: Windows 11.0.26200
PS Version(s): 5.1.26100.1882?
If so, what debug configuration (native/mixed, symbols)
or workaround should we use? Any known issues or patches?


*** Redirected to 'Former and Future Customers - Questions' section: No active maintenance ***
User avatar
Alexander Riedel
Posts: 859
Last visit: Wed Jul 01, 2026 9:50 am
Answers: 10
Been upvoted: 49 times

Re: debugging our script fails as soon as it loads a DLL

Post by Alexander Riedel »

LoadLibrary implies an unmanaged DLL rather than a managed assembly.
You likely run into calling convention issues, but without more information
it is impossible to tell.

The PowerShell debugger is not capable of debugging from PowerShell into
managed or unmanaged code in a dll. You typically need to use
Microsoft Visual Studio for that.
Without seeing the code or actual error this is just a guess, but
if your call to load the dll or calls to functions throw exceptions,
the script stops and therefore you cannot debug further.
Alexander Riedel
SAPIEN Technologies, Inc.
This topic is 4 months and 1 week old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.