Hi,
I am working on a .NET Runtime app on Windows 10 in VS 2015.
I have used the Share as ArcGIS runtime content option in ArcMap to create a geodatabase file and I have add it to me code using the Geodatabase.OpenAsync call but I keep getting the error "Unable to open the database file" with no more information:
Geodatabase geoDatabase = await Geodatabase.OpenAsync("C:/Temp/ArcGIS/_1/data/test.geodatabase");
The code is currently pointing straight at where the geodatabase file was created to make sure its not a file path issue but this still doesn't work and I've no idea what else to try.
Any help would be appreciated!
Solved! Go to Solution.
Just to close this off, I never actually found out why this issue occurred, in the end I assumed that something went wrong while setting up my dev VM so I got rid of the first VM and created a new one and everything worked correctly this time with all of the exact same code as before.
So there was definitely something messed up with the VM but I can't say what.
Thanks for the help and your suggestions
Sorry, I'm not into .NET and all that...
But what sort of geodatabase are you creating?
A file geodatabase is normally called "SomeName.gdb".
The Runtime cannot open File Geodatabases so the test.geodatabase file is created from an MXD that contains any data that you want to work with, so you add your data from a file Geodatabsae to the Map, save it as an MXD then in Share the MXD as Runtime Content which outputs the data to a .Geodatabase file which is a self contained version of your data.
At least tat is my understanding of it.
Ah, right then... Thanks for your explanation.
First thing I would try is to see if you can open the database with something other than code. Since the .geodatabase is just a SQLite database, I would suggest using DB Browser for SQLite. That should let you determine whether or not your database is
corrupted, etc.
Then make sure both the database and the folder it's are readable by everyone on windows. If you want to rule out permissions all together, then grant all privileges to all uses on the file and folder. Or you can try running your code as administrator. I had a similar problem after installing a .geodatabase into the C:/Program Files/ folder that was only accessible by the administrator.
Hi,
When you say ".NET Runtime app on Windows 10 in VS 2015." what type of app do you mean: WPF, 8.1 Store or UWP?
Additional files are created on disk when open the geodatabase (xxx.shm and xxx.wal). Perhaps the app does not have write access to that location?
Cheers
Mike
Just to close this off, I never actually found out why this issue occurred, in the end I assumed that something went wrong while setting up my dev VM so I got rid of the first VM and created a new one and everything worked correctly this time with all of the exact same code as before.
So there was definitely something messed up with the VM but I can't say what.
Thanks for the help and your suggestions