Lightswitch Web Deploy - Error 26 RRS feed

  • Question

  • Hi,

    I have been struggling with this issue for a day or so now, any help would be appreciated.

    I have a very simple Lightswitch application (HTMLClient and DesktopClient) developed on my local machine in VS 2013. I can run this locally with no issues.

    I also have a remote server with IIS8 (APP02) and separate SQL server (SQL01) running SQL 2012 Standard 64 bit, both on the same domain. I can connect to the SQL server without any issues from the IIS server using a test .udl file. The IIS Server also has a sharepoint installation and all of the associated databases for this are on the SQL server.

    When i Publish the Lightswitch App directly to the IIS server, after carefully following Beth Massi's article here, I get the following error:

    Error 98 An exception occurred when deploying the database for the application.
    An error occurred while establishing a connection to SQL Server instance 'SQL01\SQL2012DEV'.
    A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\LightSwitch\v4.5\Publish\v2.2\Microsoft.LightSwitch.Publish.targets 1565 10 IIS8LightswitchApp

    The IIS application is created successfully and i can navigate to it using the public URL, but no database is created at all. There is nothing in the Event Log of the SQL server related to this either.

    When i publish the app to a package and install the .zip file in IIS manually, the app is deployed to IIS and SQL with no issues.

    I've scoured this site, stackoverflow and the web in general looking for a resolution but so far nothing has worked. A few things that i have tried are:
    Changed the Log On user in Web Deployment Agent Service to a domain admin account
    Changed the Log On user in Web Management Service to a domain admin account
    Checked the firewalls on both servers (tried turning them off)

    Does anyone have any suggestions i can try please? Also posted on stackoverflow.


    I have also tried the following:
    Installed SQLExpress 2014 on the APP02 server - same error publishing the database.

    Deployed to my local IIS and SQL instance - deployed successfully.

    • Edited by SimonPTSG Wednesday, September 24, 2014 9:23 AM
    Wednesday, September 24, 2014 7:55 AM

All replies

  • Hi SimonPTSG,

    According to the error message above, this issue is related to connection string, update web.config connection string”, and “LightSwitchApplication_Path. For example:

    <?xml version="1.0" encoding="utf-8"?>
      <setParameter name="DatabaseAdministratorConnectionString" 
                    value="Data Source=servername\SQLEXPRESS;Initial Catalog=Application1;
                           User ID=admin;Password=adminPassword" />
      <setParameter name="DatabaseServer" value="servername\SQLEXPRESS" />
      <setParameter name="DatabaseName" value="Application1" />
      <setParameter name="DatabaseUserName" value="dbuser" />
      <setParameter name="DatabaseUserPassword" value="dbpassword" />
      <setParameter name="Application1_IisWebApplication" value="Default Web Site/Application1" />

    See: http://blogs.msdn.com/b/bethmassi/archive/2012/03/29/lightswitch-iis-deployment-enhancements-in-visual-studio-11.aspx

    Please let me know if there is anything that I can do to help.

    Best regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, September 25, 2014 8:22 AM
  • Hi Angie,

    I think that the web.config amendments you suggested are only applicable to creating App Packages, or at least that is what is suggested by Beth's article. I have tried them anyway and set the values to the same values that i have set in the Data Connections screen in the Publish dialog, but i still have the same issue - error 26.

    I can confirm that i can still deploy to a package and install on the IIS server with no issues at all, even without these extra settings in web.config.

    Do you have any other suggestions?


    Thursday, September 25, 2014 2:47 PM
  • Do you know if the SQL machine has the necessary firewall exceptions?  It would need the following Inbound rules:

    Port 1433 TCP

    Port 1434 UDP

    David Kidder | Senior SDET | Microsoft | LightSwitch

    Thursday, September 25, 2014 3:25 PM
  • Hi Dave,

    Yes, exceptions are there for those two ports and i have also tried deploying with the firewall turned off.


    • Edited by SimonPTSG Friday, September 26, 2014 7:53 AM
    Friday, September 26, 2014 7:30 AM