我有一个正在运行的,成熟的WCF服务,我试图在Windows Azure上部署为Web角色(当然还有自定义包装器)。我的RoleEntryPoint.OnStart()方法创建一个ServiceHost实例,它以零应用程序端点错误跳转。配置(web.config
)服务模型部分是:
<system.serviceModel>
<services>
<service name="Linguasys.QualitativeAnalysis.Processing" behaviorConfiguration="defaultServiceBehavior">
<endpoint address="" behaviorConfiguration="wcfAzureWrapperStoryMapping.StoryMapperAspNetAjaxBehavior" binding="webHttpBinding" contract="Linguasys.QualitativeAnalysis.IProcessing" />
<!--
<endpoint address="soap" behaviorConfiguration="" binding="basicHttpBinding" contract="Linguasys.QualitativeAnalysis.IProcessing" />
-->
</service>
</services>
<behaviors>
<endpointBehaviors>
<behavior name="wcfAzureWrapperStoryMapping.StoryMapperAspNetAjaxBehavior">
<!--
<enableWebScript />
-->
<webHttp faultExceptionEnabled="true" />
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="defaultServiceBehavior">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="false" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<webHttpBinding></webHttpBinding>
<basicHttpBinding></basicHttpBinding>
</bindings>
<protocolMapping>
<add binding="basicHttpsBinding" scheme="https" />
</protocolMapping>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true">
<!--
<serviceActivations>
<add relativeAddress="StoryMapper.svc" service="Linguasys.QualitativeAnalysis.Processing"/>
</serviceActivations>
-->
</serviceHostingEnvironment>
</system.serviceModel>
不要介意激活位,基本HTTP绑定等。稍后会添加它们以查看它是否有效。
我发现web.config
siteroot
和approot
以及所有其他地方都有{{1}}。
我错过了什么?
答案 0 :(得分:1)
您的RoleEntryPoint.OnStart()方法在WaIISHost.exe中运行,它对您的web.config一无所知。有关详细信息,请参阅http://azure.microsoft.com/blog/2010/12/02/new-full-iis-capabilities-differences-from-hosted-web-core/,有关流程运行方式的信息,请参阅http://blogs.msdn.com/b/kwill/archive/2011/05/05/windows-azure-role-architecture.aspx。
两个选项: