Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 356719
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T12:08:17+00:00 2026-05-12T12:08:17+00:00

Is there any way to debug what is going on after my .NET code

  • 0

Is there any way to debug what is going on after my .NET code calls a function in an unmanaged dll via dllimport?

I expose a dll function inside an unmanaged via dllimport. When I call a function as I step through the code, something happens and it never returns.

Is there anything I can do, maybe with debug view or anything to get any information? Or am I SOL?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T12:08:17+00:00Added an answer on May 12, 2026 at 12:08 pm

    Well, for starters, make sure you have native code debugging enabled in the Debug tab of your project’s properties.

    If you have the source code for the DLL you are calling into, then you should be able to set it up so that you can step into the native DLL just like you can the managed code. The easiest way to do this is to add the source code for the native DLL in the same solution, and then link to the output of that project. You’ll need to ensure that Visual Studio can access both the native DLL and that DLL’s pdb while running your C# application.

    If you do not have the source code for the DLL, then I’d suggest setting a breakpoint just before the call into the native method. Then, let the program continue and pause the program manually after a second or two. Make sure you’re still looking at the same thread that called into the native DLL and then look at the call stack viewer. If you see a line that says “[External Code]”, make sure that “Show External Code” is checked in the context menu. When that is checked, the call stack may be able to tell you what method is currently executing. The text will be in gray, indicating that the method is in an external DLL. If you are making Windows method calls, then installing the Windows Symbol Files first may allow the debugger to give you more information(http://www.microsoft.com/whdc/devtools/debugging/symbolpkg.mspx). You can also pause and continue the debugger several times to see what the call stack looks like at various points of execution. From this information, you may be able to get a sense of what is going wrong.

    Also, try passing in different arguments, starting with the most trivial case you can and see if you get the same behavior. Finally, make absolutely sure that you have all your marshalling metadata correct.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 206k
  • Answers 206k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Another suggestion then: How about splitting your spring config into… May 12, 2026 at 9:06 pm
  • Editorial Team
    Editorial Team added an answer Use SPList.Items doesn't return all items? Well, then try SPList.GetItems(SPQuery).… May 12, 2026 at 9:06 pm
  • Editorial Team
    Editorial Team added an answer Unfortunately, there is no programmatic control over autofocus. When the… May 12, 2026 at 9:06 pm

Related Questions

i have a c# dll which is written to act as a wrapper to
I'm currently developing a site in ASP.NET Webforms.. I'm caching things where it makes
I have been called in to clean up and get started again in a
OK, I know there have already been questions about getting started with TDD ..

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.