Silverlight / WCF部署问题

时间:2013-02-26 14:39:22

标签: wcf deployment silverlight-5.0

我有一个与WCF服务通信的Silverlight应用程序。作为web.config文件的一部分,有一个必需的部分来使用WCF:

<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" 
multipleSiteBindingsEnabled="true" />
</system.serviceModel>

部署到Windows 2008服务器后,启动Silverlight应用程序时出现以下错误:

Parser Error Message: It is an error to use a section registered as
allowDefinition='MachineToApplication' beyond application level.  This error can be
caused by a virtual directory not being configured as an application in IIS.

Source Error:

Line 29: 
Line 30: <system.serviceModel>
Line 31:         <serviceHostingEnvironment aspNetCompatibilityEnabled="true"
Line 32:             multipleSiteBindingsEnabled="true" />
Line 33:     </system.serviceModel>

经过一些研究后,有几个项目可能会导致这种情况:

  1. 应用程序所在的目录未设置为IIS中的应用程序
  2. 应用程序结构下的一个或多个子目录中存在多个web.config文件。
  3. 这两种情况都不适用于我的情况。我的应用程序 设置为IIS下的应用程序,并且应用程序结构中只有一个 web.config文件。

    此消息会发生的任何其他原因?如果我在应用程序的web.config文件中明确定义了身份验证类型,也会发生这种情况。

    感谢您的帮助。

1 个答案:

答案 0 :(得分:0)

另外,为了让它成功,我有了

... CodeBehind =“mypage.aspx.vb”inherits =“Account5.mypage”

我将其改为

... CodeFile =“mypage.aspx.vb”inherits =“mypage”

我希望这有助于其他人。