无法连接到我的Vps上的MS Sql数据库,来自我在相同Vps上的IIS7上托管的WCF服务

时间:2015-05-07 06:27:40

标签: c# sql-server web-services wcf sql-server-administration

我已经写了一个web服务,从那里我将数据传递给我的localhost Ms Sql DB。它在我的电脑上运行正常但是当我在我的godaddy Windows Vps上托管它时出现错误:

请求错误

服务器在处理请求时遇到错误。有关详细信息,请参阅服务器日志。

请注意我的vps上没有MS SQL Server,因此我已使用我的RDP手动安装它。因此,如果有一些服务器设置要完成或我必须更改我的VPS,现在idont。下面是我的web.config,请告诉我要做什么,因为我无法在网上找到这个问题的任何资源。

的web.config

<?xml version="1.0"?>
<configuration>
  <connectionStrings>
    <add name="constr" connectionString="Data Source=IP-104-238-94-8;Initial Catalog=BaySideJournalDB ;Integrated Security=True" providerName="System.Data.SqlClient"/>
  </connectionStrings>
  <appSettings/>
  <system.web>
    <compilation targetFramework="4.0" debug="true"/>
    <httpRuntime/>
  </system.web>
  <system.serviceModel>
    <services>
      <service name="ShreeGanesh.BaySideService" behaviorConfiguration="ServiceBehavior">
        <endpoint address="" binding="webHttpBinding" contract="ShreeGanesh.IBaySideService" behaviorConfiguration="webHttp"/>
        <endpoint address="mex"
                binding="mexHttpBinding" contract="IMetadataExchange" />

      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="ServiceBehavior">
          <serviceMetadata httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="false"/>
        </behavior>
        <behavior>
          <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
          <serviceMetadata httpGetEnabled="true"/>
          <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="false"/>
        </behavior>
      </serviceBehaviors>
      <endpointBehaviors>
        <behavior name="webHttp">
          <webHttp/>
        </behavior>
      </endpointBehaviors>
    </behaviors>
       <serviceHostingEnvironment aspNetCompatibilityEnabled="false" multipleSiteBindingsEnabled="true"/>
  </system.serviceModel>
  <system.webServer>

    <directoryBrowse enabled="true"/>
    <defaultDocument>

      <files>`enter code here`
        <add value="BaySideService.svc"/>
      </files>

    </defaultDocument>
  </system.webServer>
</configuration>

0 个答案:

没有答案