CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2008
    Posts
    10

    How to Debug C# code from VC++

    Hi,
    I have COM EXE Component written in C#, another dll Component written in VC++, through smart Pointer(by generating tlb) i m calling C# API's from VC++.
    My question is what options(Compiler options probably) should be specified so that when I debug from VC++ component I can stepInto C# and continue debug even there.

    Thx in Advance.

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: How to Debug C# code from VC++

    Not what you are asking, but another way to debug this is from the C# perspective. In other words, you open the C# COM project, set breakpoints, etc. and then set up the start up exe (in the debug settings) to your other C++ application. Then when you start debugging, the C+ exe is launched allowing you to debug the C# code.

    As far as the original question, be sure you have the 'debug managed code' debugger option checked.

  3. #3
    Join Date
    Mar 2003
    Location
    India {Mumbai};
    Posts
    3,871

    Re: How to Debug C# code from VC++

    As far as the original question, be sure you have the 'debug managed code' debugger option checked.
    You probably meant "Debug Unmanaged Code".

    Karth, most viable solution is to open both projects (if you have) in one solution. Set break points in C# code, start debugging executable.
    At times you need to make sure that DLL and EXE output is in same folder, so check for linker options. Most of the time, VS is smart enough to load the DLL and debugging contents even if DLL/EXE output is not same folder.
    My latest article: Explicating the new C++ standard (C++0x)

    Do rate the posts you find useful.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured