SSE, Visual Studio, and XCOPY deployment

The VSData team blogs about new database features with SQL Server Express and Visual Studio 2005. Apparently when an SSE database is added to the VS project and the project is built, the MDF gets copied to the build directory along with the EXE. When the application runs, the framework automatically finds the MDF in the application directory.

This sounds great for quick and dirty development. But is it really what you want when building a real application? If the application is installed into the Program Files directory, non-admin users won't be able to edit an MDF in the application directory (I'm assuming that the MDF doesn't just hold static data here). Aren't applications supposed to use the “Application Data” or “My Documents” folders for this kind of information? Is it just as easy to deploy the MDF to an AppData directory and have the framework automatically find it there? Do VS installer projects know how to automatically deploy MDFs to an AppData folder?

I haven't installed SSE/VSb1 yet to try it for myself. But right now this isn't sounding like a “pit of success” feature.

6 Comments

  • Reality check: webhosting.



    You make a new web based application, upload the database to you hosting center and ARE DONE.



    And this IS A valid reason. Not everyone has to do only with local apps.

  • Of course you lose all your existing data if you just rewrite the database every release. Just another useless feature...

  • Thomas,

    Yes, you're quite right, in a web app this feature makes a lot more sense. But that's not the only context in which it was discussed (and clearly I've got Smart Clients on the brain these days. :) ).

  • I cannot define myself a web developer, but I guess having MDF files installed in the application virtual directory may pose some security risks. What do you think about?

  • In the next beta, non-admins will be able to connect directly to the MDF as well. So, you'll be able to distribute your application with the .exe and the MDF without having to create any connections on the target machine. It will just work.



    Networking is turned off by default with SSE so the external security risks from a slammer type attack go away.



    Also, both the web and rich client scenarios have been pretty carefully thought through. Try it.

  • Lance,

    I've been waiting for the B1 release of the full VS2005. Once it's released, I'll check it out.



Comments have been disabled for this content.