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

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.

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.
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.

Was this article helpful?

2 out of 2 found this helpful

Have more questions? Submit a request

Comments

1 comment

  • Avatar

    Vladimir Torres

    Thanks for your help, That's exactly what I was looking for!. This fix my trouble with the events and COM object.

     

    1

Please sign in to leave a comment.