SQL CE 3.5 app won't work without Windows LUA elevation
I have a very simple CRUD app that uses SQL Server Compact (version 3.5) I want to deploy through private deployment vs. the click once installers. I have my installer created and everything works fine, minus one hiccup. The app won't work without Windows LUA elevation (Right clicking and selecting "Run as administrator").
The root cause of this, and this is my gue开发者_开发知识库ss, is that my sdf data base is sitting inside the Program Files Directory. I think I remember reading somewhere, some time ago, that this directory was read only by default with LUA. Am I remembering correctly?
Also, any work-arounds to this that you've run across? I thought about throwing the sdf in the User's directory, but if another User logs on to the computer, they will not be able to access databases.
Your best bet is to place the file in %ProgramData% - create a folder there, and set the proper ACL via a script. I have some suggestion for manipulating DataDirectory here: http://erikej.blogspot.com/2011/02/using-sql-server-compact-40-with.html (also applies to 3.5)
精彩评论