Problems debugging a COM API add-in with C# 4.0 RRS feed

  • Question

  • I hope my Title isn't too general, but I couldn't think of a better way to summarize the problem into a title.

    I've been breaking into developing via the C# language for about 7 months now, so take it easy on me.

    I am writing an add-in to a 3D CAD program called Autodesk Inventor. It has a COM API and they (Autodesk) provide a nice project template to start from which includes the proper references as well as some pre-baked code to get you started. I have been succesfully coding against it for a couple of months now and I have decided to try out the new C# 4.0 language features that just came out with VS 2010. I'm really liking the named and optional parameters, but I digress.

    When debugging, I start up an Inventor.exe session which, in short, looks to the registry and finds my add-in and loads it. The problem I'm having is actually hitting a breakpoint in my code while debugging. I have gone through several different property settings on the referenced InventorInterop.dll as well as options on debugging (among other trial and error things), none of which seems to work. The only thing that works is when I go back to an earlier .NET framework (i.e. not 4.0).

    I have tried this on other *sample* add-ins that come with the SDK and the same thing happens. The add-in loads and code gets executed, but the breakpoints don't get hit when targeting the .NET 4.0 framework.  When I switch the targeted Framework to any other framework (3.5, 3.0, 2.0) the breakpoints hit just fine. 

    I've seen that there has been some pretty nifty changes with PIAs in C# 4.0 where the portion of the PIA that gets used can be embedded into the assembly when compiled to avoid loading the entire PIA.  I have changed that setting back and forth along with other settings to no avail.

    I'm running VS 2010 Ultimate on Windows 7 Pro x32.

    Is this a problem with me, the COM interop, or something else altogether?

    Thanks in advance.

    -Brian Hall-


    I apologize for framing the question as a problem with C# 4.0 when I believe it's a problem with .NET 4.0 instead. 

    • Edited by Hallmanac Wednesday, April 28, 2010 12:00 AM Discovered something new
    • Moved by Harry Zhu Tuesday, May 4, 2010 2:44 AM (From:Visual C# Language)
    Tuesday, April 27, 2010 10:28 PM

All replies