I made an add in application for arcmap in C# and I tried to connect with my File Geodatabase. So when I tried to run it I got this error:
Error 1 Interop type 'ESRI.ArcGIS.DataSourcesGDB.FileGDBWorkspaceFactoryClass' cannot be embedded. Use the applicable interface instead.
and then the path of the add in
I have never seen this error before and I was wondering what is going wrong.
This is the main code it's all about:
public IWorkspace FileGdbWorkspaceFromPropertySet(string database)
{
IPropertySet propertySet = new PropertySetClass();
propertySet.SetProperty("DATABASE", database);
IWorkspaceFactory workspaceFactory = new FileGDBWorkspaceFactoryClass();
return workspaceFactory.Open(propertySet, 0);
}
So the error is at this line:
IWorkspaceFactory workspaceFactory = new FileGDBWorkspaceFactoryClass();
I hope someone can provide me an explanation of this error and also a possible fix in my case.
What is going wrong?
FileGDBWorkspaceFactoryClass
withFileGDBWorkspaceFactory
. I guess there were such questions, #2484159, #4220105 – Monika