zoukankan      html  css  js  c++  java
  • 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
        {
            ...

  • 相关阅读:
    JAVA设计模式之桥接模式
    Pycharm新建模板默认添加作者时间等信息
    Handler机制(2)转载
    内部类学习
    设计模式-1依赖倒置原则示例
    正则表达式
    Service原理及例子
    Serializable接口
    设计模式之静态工厂模式
    Handler机制post方法使用
  • 原文地址:https://www.cnblogs.com/zcy_soft/p/1827177.html
Copyright © 2011-2022 走看看