Blog

Error Publishing LightSwitch to Azure–Incorrect synax near ‘multi_user’

LightSwitch makes publishing your app to Azure drop dead easy once you know the process.  One scenario that may stump you occurs after you’ve published your app, make changes to your data model in LightSwitch, and then try to republish.  If those changes result in a SQL error, you’ll get the error below:

An exception occurred when deploying the database for the application.
Incorrect syntax near 'MULTI_USER'.

Not a very helpful error.  For me, this error has always been related to changes to the data source where a column has been deleted or perhaps changed to ‘Required’ when some of the current data has null data in that field.  The fix is to open up SQL Management Studio and fix the issue.  If you don’t want to keep the data, you can just drop the SQL tables and publish again.  I usually leave all the ASP.NET membership tables and just drop the table that was changed. 

So the key is to fix what ever SQL change the LightSwitch publishing is not liking.  For instance, I deleted two column in LightSwitch so the publish failed with the ‘Incorrect syntax near ‘MULTI_USER’.  So I just opened SQL Management Studio, deleted those two columns, and republished with no errors and all my other data was intact.  It would be great if the actually SQL error was passed down to you so you knew exactly what change was the problem, but hopefully knowing it might be related to SQL helps.




Delete TFS Azure Visual Studio Project

TFS Online doesn’t currently provide a way through the web portal to delete a project.  Here’s the steps to delete a TFS Online project.

1. Open VS 2012 Native Command Tools or just open a Command prompt with Run as Administrator. (Note: if you open a regular CMD prompt, you’ll need to go to the location for TFSDeleteProject.exe located at C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE assuming a 64-bit computer and that you installed VS 2012 on the C: drive).

 

2. Enter the following command and hit <ENTER>

tfsdeleteproject /collection:https://<yoursite>.visualstudio.com/DefaultCollection <projectname>

The key that’s easy to miss is the requirement to state DefaultCollection.  So if your TFS Online site is located at https://mysite.visualstudio.com and you want to delete the project MySite.Client.Testing this would be the command

tfsdeleteproject /collection:https://mysite.visualstudio.com/DefaultCollection MySite.Client.Testing

 

3. When prompted “Are you sure you want to delete the team project and all of its data”, enter Y if you’re sure (note it says it’s an irrecoverable operation).

 

That’s it.  Just hit refresh in Visual Studio or in the web portal and your project is now deleted.