Error 1, Interop Type Cannot Be Embedded

Updated Nov 20, 2017

Reported In

Software

  • TestStand 2010 SP1
  • TestStand 1.0
  • TestStand 3.1
  • TestStand 4.0
  • TestStand 4.1.1

Issue Details

When using certain TestStand types in a new Visual Studio 2010 project that targets the .NET 4.0 Framework, I am seeing an error similar to the following:

Error 1 Interop type 'NationalInstruments.TestStand.Interop.API.GetSeqFileOptions' cannot be embedded. Use the applicable interface instead.

How can I prevent this error from occurring?

Solution

This error occurs because the default value is true for the Embed Interop Types property of the TestStand API Interop assembly referenced in the new project. To resolve this error, change the value of the Embed Interop Types property to False by following these steps:
 
  1. Select the TestStand Interop Assembly reference in the references section of your project in the Solution Explorer.


     
  2. Find the Embed Interop Types property in the Property Browser, and change the value to False


WAS THIS ARTICLE HELPFUL?

Not Helpful