Monday, 9 September 2013

|DataDirectory|, you had one job

|DataDirectory|, you had one job

On my IIS 7.5 server, |DataDirectory| resolves to a directory which
doesn't exist:
C:\inetpub\wwwroot\AjaxSource\App_Data
The AppData directory which does exist as created by the web deploy tool is:
C:\inetpub\wwwroot\AjaxSource\bin\App_Data
It resolves correctly on the local machine, but when I deploy to the
server, it forgets its bin\ subdirectory. Note that I didn't specify bin\
myself -- I used the standard AppData location shown in Visual Studio
2010.
I know I can set it manually with AppDomain.SetData or similar, but my
interpretation of the point of the feature is to return the correct
location on its own. It isn't very useful if I have to tell it, first.
The connection string: "Data Source=|DataDirectory|db.sqlite;"
How do I resolve |DataDirectory|'s confusion or prevent creation of the
unnecessary bin\ folder?

No comments:

Post a Comment