• silverlight wcf 与 ria 的配置问题


    当 aspNetCompatibilityEnabled="true" 时,sl无法引用 wcf 的服务,

    wcf的 servics.svc 的文件浏览时,提示出错,如下:

    The service cannot be activated because it does not support ASP.NET compatibility. ASP.NET compatibility is enabled for this application. Turn off ASP.NET compatibility mode in the web.config or add the AspNetCompatibilityRequirements attribute to the service type with RequirementsMode setting as 'Allowed' or 'Required'.

    当aspNetCompatibilityEnabled="false"时,试运行时,又出现出错信息:

    An unhandled exception('Unhandled Error in Silverlight Application

    Code:4004

    Category:ManagedRuntimeError

    Message:

    System.ServiceModel.DomainServices.Client.DomainOperationException:

    该项目中,包括wcf服务和ria服务,请问该怎么办?

    解决方法:

    首先在web.config种设置aspNetCompatibilityEnabled="true"

    其次,在wcf service类上标记如下attribute

    using System.ServiceModel.Activation;

        [AspNetCompatibilityRequirements(
            RequirementsMode=AspNetCompatibilityRequirementsMode.Allowed)]

        public class Service2 : ClassLibrary1.IService2
        {
            ...

  • 相关阅读:
    总结报告的感想
    第14、15週PTA題目的處理
    PTA題目的處理(三)
    PTA题目的處理(四)
    PTA題目的處理(二)
    PTA題目的處理(一)
    國慶和中秋的學習成果
    剛進入大學一個月的總結和作業
    【接口平台】too many values to unpack
    【接口平台】生成静态模拟数据
  • 原文地址:https://www.cnblogs.com/zcy_soft/p/1827177.html
Copyright © 2020-2023  润新知