OCR SDK Knowledge Base

Article ID: 1168 | Category: Development Tools | Type: Hot Fix | Last Modified: 2/28/2013

Event invocation for COM objects requires event to be attributed with DispIdAttribute

Description

The “Event invocation for COM objects requires event to be attributed with DispIdAttribute” error message appears in Visual Studio 2010, .NET 4.0.

This issue doesn’t occur in .NET 2.0.

Reason

When a new Reference (Interop.FCEngine) is added to the References list, VS 2010 and .NET 4.0 may automatically set the value of the Embed Interop Types property of the new Reference to TRUE. This property was introduced as a way to overcome the difficulties associated with deploying Primary Interop Assemblies (for more information see http://blogs.msdn.com/b/samng/archive/2010/01/24/the-pain-of-deploying-primary-interop-assemblies.aspx).

The default setting for this property in .NET 2.0 is FALSE, which is why you don’t receive any error messages when you run the Test application in .NET 2.0.

Solution
screenshot

You need to check your Embed Interop Types flag:

  1. Click on the FCEngine reference;
  2. In the Properties pane, change "Embed Interop Types" to False.
438 people think this is helpful.
Was this information helpful to you?