Troubleshooting

Refer to the following list for additional reference if you have difficulty creating a .NET C# application:

  • Unable to Find the Cognex.VisionPro.Control.Net package?

    1. Choose Tools->Options from Visual Studio.
    2. Scroll down to NuGet Package Manager and select Package Sources.
    3. Verify that Cognex_Local is available as a package source:

    4. If it does not appear as a package source click the "+" button and specify:

      Name: Cognex_Local

      Source: C:\ProgramData\Cognex\.nuget\packages

    5. Click Update.
  • Cognex.Rbbt.Interop.TypeSystemException: 'Unable to find the Factory for TypeId '1234...'

    If you see the following exception error: 

    Copy
    Cognex.Rbbt.Interop.TypeSystemException
    HResult=0x80131500
    Message=Unable to find the Factory for TypeId '1756358770240'.
    Please ensure you have called Cognex.Vision.Startup.Initialize()

    This indicates that the VisionPro backend has not been initialized. Ensure your static void Main() method contains a call to the Initialize() method: 

    Copy
    [STAThread]
    static void Main()
    {
        Cognex.Vision.Startup.Initialize();
        ...
        ...
        Cognex.Vision.Startup.Shutdown(); 
    }
  • System.RuntimeInteropServices.COMException

    The following exception indicates an issue with the manifest file.

    Copy
    Exception thrown: 'System.Runtime.InteropServices.COMException' in System.Windows.Forms.dll
    An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in System.Windows.Forms.dll
    Class not registered (0x80040154 (REGDB_E_CLASSNOTREG))

    Try either recommendation: