【发布时间】:2015-05-25 10:51:42
【问题描述】:
我正在尝试使用 WCF WebRole 在 Azure 云服务上托管 WCF REST 服务。这是我的 web.config 文件:
<?xml version="1.0"?>
<configuration>
<system.webServer>
<system.diagnostics>
<trace>
<listeners>
<add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=2.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="AzureDiagnostics">
<filter/>
</add>
</listeners>
</trace>
</system.diagnostics>
<!--
For a description of web.config changes see http://go.microsoft.com/fwlink/?LinkId=235367.
The following attributes can be set on the <httpRuntime> tag.
<system.Web>
<httpRuntime targetFramework="4.5" />
</system.Web>
-->
<system.web>
<compilation debug="true" targetFramework="4.5"/>
<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/>
</system.web>
<system.serviceModel>
<services>
<service name="WCFServiceWebRole1.Service1" behaviorConfiguration="ServiceBehavior">
<endpoint address="" binding="webHttpBinding" contract="WCFServiceWebRole1.IService1" behaviorConfiguration="web"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="ServiceBehavior">
<!-- To avoid disclosing metadata information, set the value below to false before deployment -->
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="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="web">
<webHttp/>
</behavior>
</endpointBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>
</system.serviceModel>
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="MySql.Data" publicKeyToken="C5687FC88969C44D" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-6.9.6.0" newVersion="6.9.6.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
我收到 HTTP 500.19 内部服务器错误。 http://i.stack.imgur.com/HgfgV.png
所以现在如果我想在 IIS 管理器的应用程序池设置中更改目标 .net 框架,我该怎么做?
我是这方面的初学者。非常感谢您的帮助。
【问题讨论】:
标签: c# wcf azure iis web-config