简体   繁体   English

500-内部服务器错误,Windows Azure云服务

[英]500 - Internal Server Error, Windows Azure Cloud Service

I have just switched from WCF Service to Windows Azure Cloud Service. 我刚刚从WCF服务切换到Windows Azure云服务。 I have copied over my codes from my WCF service into the Cloud service. 我已将代码从WCF服务复制到Cloud服务中。 When i run the website i get 当我运行网站时,我得到

500 - Internal Server Error. 500内部服务器错误。 There is a problem with the resource you are looking for, and it cannot be displayed. 您正在寻找的资源有问题,无法显示。

Here is my code for my Web.config: 这是我的Web.config代码:

<?xml version="1.0"?>
<configuration>
  <connectionStrings>
 <add name="PCSDB" connectionString="Data Source=vlnucbukr8.database.windows.net;Initial Catalog=PCSDB;User ID=ProjectPublicLogin;Password=****" providerName="System.Data.SqlClient" />
 </connectionStrings>
  <configSections>
  </configSections>
  <system.diagnostics>
   <trace>
     <listeners>
      <add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"name="AzureDiagnostics">
        <filter type="" />
       </add>
    </listeners>
    </trace>
  </system.diagnostics>
  <system.web>
    <compilation debug="true" targetFramework="4.0" />
 <customErrors mode="Off"/>
</system.web>
 <system.serviceModel>
   <services>
     <service name ="WCFServiceWebRole1.AllocationService">
      <endpoint address="" behaviorConfiguration="AllocationBehavior" binding="webHttpBinding" bindingConfiguration="" contract="WCFServiceWebRole1.IAllocationService">
       </endpoint>
      <host>
       <baseAddresses>
         <add baseAddress="http://localhost/allocationservice"/>
        </baseAddresses>
     </host>
    </service>
  </services>
   <behaviors>
     <serviceBehaviors>
       <behavior>
         <serviceDebug includeExceptionDetailInFaults="false"/>
       </behavior>
      </serviceBehaviors>
      <endpointBehaviors>
        <behavior name="AllocationBehavior">
          <webHttp/>
        </behavior>
   </endpointBehaviors>
 </behaviors>
   <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
 </system.serviceModel>
 <system.webServer>
   <validation validateIntegratedModeConfiguration="false"/>
    <modules runAllManagedModulesForAllRequests="true"/>
    <httpErrors>
     <remove statusCode="500" subStatusCode="100" />
      <error statusCode="500" subStatusCode="100" prefixLanguageFilePath="" path="/errors.asp" responseMode="ExecuteURL" />
    </httpErrors>
  </system.webServer>
</configuration>

Found the solution.. 找到了解决方案。

  <configSections>  </configSections> 

have to be the first child of the 必须是

  <configuration> 

tag 标签

与其将整个代码从服务复制到云程序,不如在解决方案中添加一个Cloud项目,然后右键单击角色并从解决方案中添加现有角色。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 插入Windows Azure移动服务时出现500内部服务器错误? - 500 Internal Server Error while inserting to Windows Azure Mobile Services? HttpClient.SendAsync:500 - Windows服务应用程序中的内部服务器错误 - HttpClient.SendAsync: 500 - Internal Server Error in Windows Service Application azure api azure 内部服务器错误 500 - azure api azure internal server error 500 WCF 休息服务 500 内部服务器错误 - WCF rest service 500 internal server error 作为Windows服务运行的ASP.NET Core出现500内部服务器错误 - ASP.NET Core Running as Windows Service gets 500 Internal Server Error 远程服务器返回错误:(500)内部服务器错误Web服务 - The remote server returned an error: (500) Internal Server Error Web service 从Windows服务将数据发布到Web应用程序时出错。“远程服务器返回错误:(500)内部服务器错误。” - Error While posting Data to a web application from a windows service.“The remote server returned an error: (500) Internal Server Error.” ASP.NET 5(vNext)在Azure上导致500 - 内部服务器错误 - ASP.NET 5 (vNext) causing a 500 - Internal Server Error on Azure Azure Function 来自 SocketException 的代理内部服务器错误 500 - Azure Function Proxy Internal Server Error 500 from SocketException Web服务响应返回500内部服务器错误 - Web Service Response returns a 500 Internal Server Error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM