Using a VS2010 SP1 Data-tier application project, I created the simplest database I could:
CREATE TABLE [dbo].[Table1]
(
column_1 int NOT NULL,
column_2 int NULL
)
I then successfully built the .dacpac, and verified it by deploying it using SSMS 2008 R2 to a local SQL Express instance (everything worked fine).
I then tried using SSMS 2008 R2 to deploy the .dacpac to a SQL Azure server. The wizard managed to get through every step (including creating the database and creating the schema), but failed on the last step - "Registering the DAC in DAC metadata" - with an IndexOutOfRangeException (see below).
I tried to do this against an existing SQL Azure server, against a new SQL Azure server (both fail with the same exception), and against a SQL Azure server with an empty database by the same name (this one failed with an SSMS runtime exception).
I'm now out of ideas. Any ideas on how to deploy .dacpacs to SQL Azure would be greatly appreciated.
System.IndexOutOfRangeException: Index was outside the bounds of the array. at Microsoft.SqlServer.Management.Smo.SqlPropertyMetadataProvider.PropertyNameToIDLookupWithException(String propertyName, PropertyAccessPurpose pap) at Microsoft.SqlServer.Management.Smo.SqlSmoObject.GetDbComparer(Boolean inServer) at Microsoft.SqlServer.Management.Smo.SqlSmoObject.InitializeStringComparer() at Microsoft.SqlServer.Management.Smo.AbstractCollectionBase.get_StringComparer() at Microsoft.SqlServer.Management.Smo.SimpleObjectCollectionBase.InitInnerCollection() at Microsoft.SqlServer.Management.Smo.SmoCollectionBase.get_InternalStorage() at Microsoft.SqlServer.Management.Smo.SmoCollectionBase.GetObjectByKey(ObjectKeyBase key) at Microsoft.SqlServer.Management.Smo.DatabaseCollection.get_Item(String name) at Microsoft.SqlServer.Management.Dac.RegisterDacStep.Execute() at Microsoft.SqlServer.Management.Dac.TransactionalActionManager.ManagedActionStep.TransactionalStep.DoExecute() at Microsoft.SqlServer.Management.Dac.TransactionalActionManager.ManagedActionStep.Execute() at Microsoft.SqlServer.Management.Dac.TransactionalActionManager.ExecuteActionSteps(IEnumerable`1 managedActionSteps) at Microsoft.SqlServer.Management.Dac.TransactionalActionManager.Go() at Microsoft.SqlServer.Management.Dac.DacStore.Install(DacType dacType, DatabaseDeploymentProperties deploymentProperties, Boolean skipPolicyValidation, Boolean skipDacRegistration)
According to Microsoft, there is apparently some kind of issue around which order you install VS 2010 SP1 and SQL 2008 R2 SP1.
Herve's answer may address the problem as well (i.e. reinstall SQL 2008 R2 SP1), but I was not able to verify it because I already solved the issue by following the SQL Azure team's recommended solution - go to http://www.microsoft.com/download/en/details.aspx?id=26728 and download / install the new SMO MSI (which is listed as 1033\x64\SharedManagementObjects.msi).
Thanks MS!