1

I'm trying to use one-click web deploy to a shared host. The website loads properly, however links that go to pages looking for the database gives

[Win32Exception (0x80004005): The system cannot find the file specified]

[SqlException (0x80131904): 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: 52 - Unable to locate a Local Database Runtime installation. Verify that SQL Server Express is properly installed and that the Local Database Runtime feature is enabled.)]

This SO answer says that:

...the host will need to setup web deploy and provide you with non-admin deploy credentials.

There's a full guide on iis.net. The process will output a .publishsettings file to the desktop, which you can import into Visual Studio's publish dialog.

I'm with MyASP.net, and they are running WS 2012. I just want to make sure the solution is not on my end before I send them on a wild goose chase.

My publish profile is:

<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <WebPublishMethod>MSDeploy</WebPublishMethod>
    <LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
    <LastUsedPlatform>Any CPU</LastUsedPlatform>
    <SiteUrlToLaunchAfterPublish>http://abalter-001-site1.myasp.net/</SiteUrlToLaunchAfterPublish>
    <LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
    <ExcludeApp_Data>False</ExcludeApp_Data>
    <MSDeployServiceURL>https://abalter-001-site1.myasp.net:8172/MsDeploy.axd</MSDeployServiceURL>
    <DeployIisAppPath>abalter-001-site1</DeployIisAppPath>
    <RemoteSitePhysicalPath />
    <SkipExtraFilesOnServer>True</SkipExtraFilesOnServer>
    <MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
    <EnableMSDeployBackup>True</EnableMSDeployBackup>
    <UserName>ifc\abalter-001</UserName>
    <_SavePWD>True</_SavePWD>
    <PublishDatabaseSettings>
      <Objects xmlns="">
        <ObjectGroup Name="GatorsContext" Order="1" Enabled="False">
          <Destination Path="" />
          <Object Type="DbCodeFirst">
            <Source Path="DBContext" DbContext="Gators3.Models.GatorsContext, Gators3" Origin="Configuration" />
          </Object>
        </ObjectGroup>
        <ObjectGroup Name="DefaultConnection" Order="2" Enabled="False">
          <Destination Path="" />
          <Object Type="DbCodeFirst">
            <Source Path="DBContext" DbContext="Gators3.Models.ApplicationDbContext, Gators3" Origin="Configuration" />
          </Object>
        </ObjectGroup>
      </Objects>
    </PublishDatabaseSettings>
  </PropertyGroup>
  <ItemGroup>
    <MSDeployParameterValue Include="$(DeployParameterPrefix)DefaultConnection-Web.config Connection String" />
    <MSDeployParameterValue Include="$(DeployParameterPrefix)GatorsContext-Web.config Connection String" />
  </ItemGroup>
</Project>

Web deploy settings from host: enter image description here

UPDATE I got it working. I wasn't actually entering the connection string for the database server on the host. This information was given to me by the host. When I put it in the web-deploy settings, all was well.

enter image description here

Community
  • 1
  • 1
abalter
  • 9,663
  • 17
  • 90
  • 145
  • But if it's "wrong", then why would the app work fine on my local machine? – abalter Jun 09 '15 at 07:20
  • I added an image to my post that is a snip from my myasp.net control panel where they explicitly give the web deploy settings. There is nothing there about setting a different connection string. I actually thought that web deploy was supposed to make some changes to the Web.config as it uploaded it. Do you have any ideas for what I could do to create a different connection string? – abalter Jun 11 '15 at 05:14
  • Helpdesk also told me I need to change the connection string. l changed it to what is given to my by the database manager in my control panel: `"Data Source=SQL5013.myASP.NET;Initial Catalog=DB_9C4813_abalter;User Id=DB_9C4813_abalter_admin;Password=YOUR_DB_PASSWORD;" ` I put in my real password, of course. Now I get an error that: `The connection string 'GatorsContext' in the application's configuration file does not contain the required providerName attribute.` Microsoft does seem to indicate that the process should be automatic. They call it one-click. – abalter Jun 12 '15 at 04:05
  • Maybe this is what you were trying to tell me: I wasn't entering the connection string for the sql server on the host in the web deploy sql server settings! I added a picture to my post. – abalter Jun 12 '15 at 05:46
  • If you want to post an explanatory answer, I'll accept it. Otherwise, I'll answer myself. – abalter Jun 12 '15 at 05:47

0 Answers0