System.Net.WebException:远程服务器返回错误:(500)内部服务器错误。在System.Net.HttpWebRequest.GetResponse()在SMS.Testpage.btnsubmit_Click(对象发件人,EventArgs e)System.Net.WebException:远程服务器返回错误:(500)内部服务器错误。
这是我得到当我上传我的文件到远程服务器的错误。在本地主机的情况下,它工作正常,并返回我期待的相同的扫描笏,但我不明白为什么它的行为是这样的,如果有人对我的错误有想法,请让我摆脱这个大问题。自3周以来,我一直在努力解决这个问题。
这里是我的web配置的代码---当它在服务器运行
<configuration>
<connectionStrings>
<add name="mydbcon" connectionString="Data Source=xyz;Initial Catalog=smspro;Persist Security Info=True;User ID=xyz;Password=xyz" />
</connectionStrings>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime />
<webServices>
<protocols>
<add name="HttpGet"/>
<add name="HttpPost"/>
</protocols>
</webServices>
<!--<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/>-->
</system.web>
<appSettings />
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="epBasicHttp" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None" realm=""/>
<message clientCredentialType="UserName" algorithmSuite="Default"/>
</security>
</binding>
</basicHttpBinding>
<netTcpBinding>
<binding name="tcpBinding" receiveTimeout="00:15:00" sendTimeout="00:15:00" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647">
<security mode="None">
<transport clientCredentialType="None" protectionLevel="None" />
<message clientCredentialType="None" />
</security>
</binding>
<!--<binding name="epNetTcp" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions" hostNameComparisonMode="StrongWildcard" listenBacklog="10" maxBufferPoolSize="524288" maxBufferSize="65536" maxConnections="10" maxReceivedMessageSize="65536">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384"/`enter code here`>
<reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false"/>
<security mode="None">
<transport clientCredentialType="Windows" protectionLevel="EncryptAndSign"/>
<message clientCredentialType="Windows"/>
</security>
</binding>-->
</netTcpBinding>
</bindings>
<services>
<service name="SMS.Services.Communication">
<endpoint address="http://localhost:3053/Services/Communication.svc" binding="webHttpBinding" contract="SMS.Services.ICommunication"
behaviorConfiguration="Web"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="Web">
<webHttp/>
</behavior>
</endpointBehaviors>
</behaviors>
<serviceHostingEnvironment minFreeMemoryPercentageToActivateService="0"/>
<!--<serviceHostingEnvironment minFreeMemoryPercentageToActivateService="0" />-->
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>
调试您的服务器或查看日志找到确切的问题,不可能找到没有信息的问题。 –