我有一个与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>
经过一些研究后,有几个项目可能会导致这种情况:
这两种情况都不适用于我的情况。我的应用程序 设置为IIS下的应用程序,并且应用程序结构中只有一个 web.config文件。
此消息会发生的任何其他原因?如果我在应用程序的web.config文件中明确定义了身份验证类型,也会发生这种情况。
感谢您的帮助。
答案 0 :(得分:0)
另外,为了让它成功,我有了
... CodeBehind =“mypage.aspx.vb”inherits =“Account5.mypage”
我将其改为
... CodeFile =“mypage.aspx.vb”inherits =“mypage”
我希望这有助于其他人。