This project has moved and is read-only. For the latest updates, please go here.

Path for embedded stores

Jan 19, 2014 at 9:14 PM
I'd like my connection string to point to the "App_Data" folder. I can't seem to find the combination that works.

If I point it specifically to, say, "C:\DataStores\BrightStarDB", then the data store is created there.

However, something like this doesn't work:
Type=embedded; StoresDirectory=\App_Data;StoreName=MyStore

Nor does:
Type=embedded; StoresDirectory=..\App_Data;StoreName=MyStore

Nor does:
Type=embedded; StoresDirectory=App_Data;StoreName=MyStore

How do I get BrightStarDB to use a relative path within my web-site?
Jan 20, 2014 at 12:53 PM
A relative path will be resolved against the current directory, which is a system level feature that will probably vary depending on which container your app is running in. I would recommend that you do one of the following:

a) Just put a fully specified path into the connection string
b) Make the connection string at runtime using Server.MapPath() to turn the relative path into a fully specified path
Jan 25, 2014 at 9:33 PM
Thanks. I did something similar to option b). I put all my contexts (Entity Framework, BrightstarDb, etc.) in assemblies distinct from the UI (web) assembly, so ended up using a different call than Server.MapPath().

I put up a sample on a subdomain of mine on GoDaddy, and after fixing the trust level, was able to get the store initialized and the first page loaded. All of this is experimental ...
Jan 28, 2014 at 10:36 AM
Yeah I would have liked to be able to do the MapPath inside BrightstarDB, but to do that drags along all the web assemblies which is not what I want. Glad you have something up and running!