Help from RasterWorkspaceFactoryClass

11-03-2011 02:10 AM
New Contributor
I'm trying instantiate RasterWorkspaceFactoryClass whith following snippet code,

  IWorkspaceFactory workspaceFactory = new RasterWorkspaceFactoryClass();

and the compiler generate this error

ESRI.ArcGIS.DataSourcesRaster.RasterWorkspaceFactoryClass' can not be embedded. Use the interface of its place.

I copied the code of a example of version 9.3  arcgis objects api.

anyone can help me?
0 Kudos
1 Reply
Regular Contributor III
I believe this is because your project is referencing the .NET Framework 4.0.  Open your Project properties and click on the References tab.  Highlight all of the ESRI references.  In the Properties window set Embed Interop Types to False.  You really should change your project to reference the .NET Framework 3.5 since 4.0 is not supported by ESRI at ArcGIS 10 and you may run into other problems.
0 Kudos