14

My class derives from System.Web.Security.MembershipUser I am getting this error when submitting the form. The popup form uses ASPPDFand the application did not have this problem before implementing the custom MembershipProvider goodies. Note this is a debugging error only. It seems to work when I am not debugging. Does anyone know how I can fix this?

NonComVisibleBaseClass was detected Message: A QueryInterface call was made requesting the default IDispatch interface of COM visible managed class 'XyAmpUser'. However since this class does not have an explicit default interface and derives from non COM visible class 'System.Web.Security.MembershipUser', the QueryInterface call will fail. This is done to prevent the non COM visible base class from being constrained by the COM versioning rules.

Thanks, ~ck in San Diego

Matt
  • 25,467
  • 18
  • 120
  • 187
Hcabnettek
  • 12,678
  • 38
  • 124
  • 190
  • **Note:** This occurs not only with asp.net and pdf-generation, I had this error in a project with .NET Windows Forms and Entity Framework too. Hence, I have left a comment in Jeremy's answer, because the place where to find this setting has changed in Visual Studio 2019. – Matt Nov 19 '19 at 09:12

2 Answers2

18

I have recently discovered this error in a totally unrelated scenario to yours.

  1. Navigate to Debug->Exceptions...
  2. Expand "Managed Debugging Assistants"
  3. Uncheck the NonComVisibleBaseClass Thrown option.
  4. Click [Ok]

Here is more information, which may help.

Just to keep this up to date:

In Visual Studio 2019: Debug Menu, Windows --> Exception settings, opens the Exception settings window. There expand "Managed Debugging Assistants" and finally uncheck NonComVisibleBaseClass

Jeremy
  • 44,950
  • 68
  • 206
  • 332
  • 2
    Copying the answer from the linked thread in case it disappears: "1. Navigate to Debug->Exceptions... 2. Expand "Managed Debugging Assistants" 3. Uncheck the NonComVisibleBaseClass Thrown option. 4. Click [Ok]" – VitalyB Aug 23 '10 at 16:09
  • 5
    Could not find it in **Visual Studio 2019** first. Here's the place: **Debug** Menu, **Windows --> Exception settings**, opens the Exception settings window. There expand **"Managed Debugging Assistants"** and finally uncheck **NonComVisibleBaseClass** – Matt Nov 15 '19 at 10:06
0

this is telling you that: Your project contains some COM based objects which is not signed with a key to public usage.

There are 2 solution to this case:

1- Uncheck NonVisibleCome choice from the debugger settings

2- Find your objects code sign it and rebuild it.

StayOnTarget
  • 11,743
  • 10
  • 52
  • 81
Hamit YILDIRIM
  • 4,224
  • 1
  • 32
  • 35