locked
Encountered The "CreateSqlUser" task failed unexpectedly when publishing RRS feed

  • Question

  • We found that when we had a dash in the in sql user name in the user connection, we encountered a "The "CreateSqlUser" task failed unexpectedly" incorrect syntax near '-'.  
    Friday, April 19, 2013 7:48 PM

Answers

  • Yes, removed the dash and it worked.  It appeared to be a problem with the LS targets file:

    C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\LightSwitch\v2.0\Publish\v1.0\Microsoft.LightSwitch.Publish.targets

    Saturday, April 20, 2013 6:00 AM

All replies

  • Thanks eromo1,

    I'll pass this along to the team to investigate. Were you able to get past the problem once you removed the dash from the connection?

    Cheers,
    -Beth


    Senior Program Manager, Visual Studio Community http://www.bethmassi.com http://msdn.com/lightswitch http://dev.office.com

    Friday, April 19, 2013 10:33 PM
  • Yes, removed the dash and it worked.  It appeared to be a problem with the LS targets file:

    C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\LightSwitch\v2.0\Publish\v1.0\Microsoft.LightSwitch.Publish.targets

    Saturday, April 20, 2013 6:00 AM
  •  

    Line 1150:

     <CreateSqlUser ConnectionString="$(PublishConnectionString)"
                           UserName="$(SqlUserName)"
                           Password="$(SqlUserPassword)"
                           AuthenticationType="$(AuthenticationType)"
                           Condition=" '$(CreateSqlUser)' == 'true' and '$(SqlUserName)' != 'sa' " />

    Saturday, April 20, 2013 6:03 AM
  • Beth,

    I am receiving the same error message but I have no dash in the user connection. Trying to publish your Customer Service sample as a test. Any suggestions?

    Error 1 The "CreateSqlUser" task failed unexpectedly.
    System.Data.SqlClient.SqlException (0x80131904): Incorrect syntax near '.'.
       at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
       at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
       at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
       at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout)
       at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)
       at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
       at Microsoft.LightSwitch.Publish.Tasks.Deployment.CreateSqlUser.ExecuteCommand(SqlConnection connection, String commandText)
       at Microsoft.LightSwitch.Publish.Tasks.Deployment.CreateSqlUser.Execute()
       at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
       at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__20.MoveNext()
    ClientConnectionId:f6feed89-83f4-4f95-9327-d8f1bdcd72dd C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\LightSwitch\v2.0\Publish\v1.7\Microsoft.LightSwitch.Publish.targets 1222 10 CustomerService1

    Sunday, May 26, 2013 3:26 AM