none
Error in publishing Lightswitch app. "Could not generate the deployement script." RRS feed

  • Question

  • Good morning to everyone,

    I'm getting frustrated with this error message "An exception occured when building the database for the application. Could not generate the deployement script." when deploying the lightswitch app. It only popups when it comes to the last step of publishing.

    It happens in the Microsoft.Lightswitch.Publish.targets file, that I've never touched before.

    See the image in full size

    An exception occured when the database for the application. Could not generte the deployement script.

    Thank you in advance,

    Anas,




    • Edited by Anas.Kar Friday, December 19, 2014 9:12 AM
    Friday, December 19, 2014 8:59 AM

Answers

  • Also Anas,

    Are you publishing to a hosted environment other than Azure?  If so.. when you are going thru the publishing wizard and come to the Data Connections tab.  That you DO NOT select the option to "Generate a new database".  It will fail every time.

    You need to create your empty database at the provider, then in the wizard, select "Update an existing database". 

    In fact, if you try to go with option 1.  The providers SQL Server will, most times, take the database offline and it won't be able to be brought back online.  So your option then is to create another database with a new name and go down the Update vs Generate a new.

    Make any sense?  If not, make sure you take a look at my video for deploying to a shared host.  It shows exactly what I mean.

    dale

    • Marked as answer by Anas.Kar Sunday, December 21, 2014 6:01 PM
    Saturday, December 20, 2014 1:46 AM

All replies

  • Good day Anas,

    This error has to do with your Visual Studio not being able to connect to the remote data source.

    Have you checked to make sure you can get to the source via SQL Server Manager or another tool like dbForge?

    dale

    Saturday, December 20, 2014 1:35 AM
  • Also Anas,

    Are you publishing to a hosted environment other than Azure?  If so.. when you are going thru the publishing wizard and come to the Data Connections tab.  That you DO NOT select the option to "Generate a new database".  It will fail every time.

    You need to create your empty database at the provider, then in the wizard, select "Update an existing database". 

    In fact, if you try to go with option 1.  The providers SQL Server will, most times, take the database offline and it won't be able to be brought back online.  So your option then is to create another database with a new name and go down the Update vs Generate a new.

    Make any sense?  If not, make sure you take a look at my video for deploying to a shared host.  It shows exactly what I mean.

    dale

    • Marked as answer by Anas.Kar Sunday, December 21, 2014 6:01 PM
    Saturday, December 20, 2014 1:46 AM
  • Thank you Dale,

    I cannot access the database from SQL server Manager (I didn't try dbForge yet) but I can get access to it from the "VS 2013 Server Explorer".

    Well I let down the Create the package on disk option for now, because the message box "Publishing..." never ends. I'll return to this option when I have the time and watch your video with more attention.

    The other option Publish directly to a server now to a shared host (the same shared host that you talked about on your blog) is working fine for now.

    Thanks again.


    • Edited by Anas.Kar Sunday, December 21, 2014 6:41 PM
    Sunday, December 21, 2014 6:39 PM
  • Interesting you were able to publish directly to the server.  How did you get around the certificate issue?
    Tuesday, December 23, 2014 4:45 PM
  • Hi Dale,

    Are you referring to SSL? I didn't use any certificate till now, because my app isn't finished yet. When I'm done, I'll have to see your article again to include the ssl.

    The only issue that I had when I deployed it the first time is a message error telling me that I have to add a line in my LS project Web.config (I don't remember wich one).

    Here are the steps that I used, I know you know it before but it can help other people on this forum.

    Tuesday, December 23, 2014 5:46 PM