I made an application to add arcmap in C #, and I tried to connect to my 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 add path in
I had never seen this error before, and I was wondering what was going wrong.
This is the main code:
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 in this line is:
IWorkspaceFactory workspaceFactory = new FileGDBWorkspaceFactoryClass();
I hope someone can give me an explanation of this error, as well as a possible fix in my case.
What is going wrong?
source share