Wcf Azure Web角色加速器&;serviceHostingEnvironment aspNetCompatibilityEnabled=";“真的”;
我不确定此问题是否特定于Web角色加速器(WAAWR:) 编辑:我已确认此错误仅在我的WAAWR应用程序中引发-如果我部署与独立webrole相同的代码,则不会引发此错误 我试图在通过WAAWR部署的应用程序上运行WCF路由/清除URL。此功能需要asp.net兼容模式。以下是我的配置部分:Wcf Azure Web角色加速器&;serviceHostingEnvironment aspNetCompatibilityEnabled=";“真的”;,wcf,azure,azure-web-roles,Wcf,Azure,Azure Web Roles,我不确定此问题是否特定于Web角色加速器(WAAWR:) 编辑:我已确认此错误仅在我的WAAWR应用程序中引发-如果我部署与独立webrole相同的代码,则不会引发此错误 我试图在通过WAAWR部署的应用程序上运行WCF路由/清除URL。此功能需要asp.net兼容模式。以下是我的配置部分: <system.serviceModel> <serviceHostingEnvironment aspNetCompatibilityEnabled="true">
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true">
<baseAddressPrefixFilters>
<add prefix="http://api.mydomain.com"/>
</baseAddressPrefixFilters>
</serviceHostingEnvironment>
<standardEndpoints>
<webHttpEndpoint>
<standardEndpoint name="" helpEnabled="true" automaticFormatSelectionEnabled="true"/>
</webHttpEndpoint>
</standardEndpoints>
</system.serviceModel>
我被这个错误困扰了几个小时:
System.IO.FileLoadException:文件名:
\?\C:\Resources\directory\xxxxxxxxxxxxxxxxxxxx\web.config
行号:74错误:此配置节不能用于
这条路。当节在父级锁定时会发生这种情况。
默认情况下(overrideModeDefault=“Deny”)或设置锁定
通过带有overrideMode=“Deny”的位置标记或传统
allowOverride=“false”。在
Microsoft.Web.Administration.Interop.IAppHostAdminManager.GetAdminSection(字符串
bstrSectionName,字符串bstrPath)位于
Microsoft.Web.Administration.WebConfiguration Manager.GetSectionInternal(字符串
siteName、String virtualPath、String sectionPath、Type sectionType)
起初,我认为您通过web角色主机部署的应用程序是子目录/虚拟目录,因此我将此配置扔到部署主机应用程序本身的.config文件中,但这并没有奏效。我打开远程桌面查看发生了什么,通过主机部署的每个应用程序看起来都是IIS下自己的应用程序。此外,当您从IIS管理器浏览应用程序时,这些应用程序不会与部署主机位于同一驱动器上。所以我不确定为什么会抛出这个错误
有什么想法吗?我在这里找到了答案:
不确定它为什么能与普通角色一起工作&您必须为子应用程序添加节声明-但很高兴它能工作