How to: Prepare a Database for Deployment From a Command Prompt by Using VSDBCMD.EXE shows how to upgrade the schema of a database on a remote server. However I encountered a problem this week running vsdbcmd.exe on a Windows Server 2008 R2 64bit machine:

`

vsdbcmd.exe /action:deploy /dd+ /manifestFile:Project.Database.deploymanifest An unexpected failure occurred: An attempt was made to load a program with an in correct format. (Exception from HRESULT: 0x8007000B)

`

This error normally implies that you've got a mismatch between 32bit and 64bit dlls. I'd copied the DLLs from my Windows 7 32bit development virtual machine, so that made some sense.

It was suggested I copy the DLLs from a 64bit machine, but unfortunately that had no effect. I then noticed that some of the sqlce dlls did appear to be 32bit-specific.

I then downloaded and installed both the 32 and 64bit versions of SQL Compact 3.5 SP2 on the server, and removed the original sqlce dlls that I'd copied along with vsdbcmd.exe.

That seems to have fixed the problem – vsdbcmd now executes correctly.

So the actual list of DLLs ended up copying to the server now that the SQL Compact files are already installed are:

  • Extensions (folder)
  • DatabaseSchemaProviders.Extensions.xml
  • Microsoft.Data.Schema.dll
  • Microsoft.Data.Schema.ScriptDom.dll
  • Microsoft.Data.Schema.ScriptDom.Sql.dll
  • Microsoft.Data.Schema.Sql.dll
  • Microsoft.Data.Schema.Utilities.dll
  • System.Data.SqlServerCe.dll
  • vsdbcmd.exe
  • vsdbcmd.exe.config