Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a valid and existent workspace (file geodatabase) in a specific folder.

    public void WorkspaceHandler_TestConstructor_FileGdbWorkspace()
        workHandler = new WorkspaceHandler(gdbWorkspace);

        IWorkspace workspace = workHandler.GetCurrentWorkspace;

        Assert.AreEqual(gdbWorkspace, workspace.PathName);
        Assert.AreEqual(esriWorkspaceType.esriLocalDatabaseWorkspace, workspace.Type);
        Assert.AreEqual(false, workspace.IsDirectory());
        Assert.AreEqual(true, workspace.Exists());

My last assert fails. All the other ones are working OK.

Is there any sort of specificity on this particular method?

share|improve this question
up vote 3 down vote accepted

I'm able to reproduce this with 9.3.1 - I'd call it a bug. I never use this method. Instead, I use IWorkspaceFactory.IsWorkspace. The help doc says IWorkspace.Exists is there so you can detect if the underlying files for a workspace have been deleted by another app. I'd bet IsWorkspace can do this too, but I'd check.

share|improve this answer
Thanks for the info Kirk. All uses os Exists() fails. This on 9.3.1 too. Should I call ESRI? :P – George Jul 27 '10 at 14:37
Shapefile workspaces return true for Exists() for me. ESRI's gotten a lot more responsive about bugs lately, you might give it a try. (If you can reproduce on 10.0 I bet they'd be more responsive though). – Kirk Kuykendall Jul 27 '10 at 16:21

This is a bug which was fixed in ArcGIS 10.0.

share|improve this answer
thanks for the help :P. saved me some trouble. – George Jul 31 '10 at 20:39

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.