asp.net使用 csla 序列化错误 有关于wcf的错误.

自己做一个网站项目,使用asp.net mvc 

想使用csla框架,以方便以后扩展.

使用中出现以下错误:

 

格式化程序尝试对消息反序列化时引发异常: 尝试对参数 http://ws.lhotka.net/WcfDataPortal 进行反序列化时出错: request。InnerException 消息是“在行 1、位置 1735 处出现错误。 “EndElement”命名空间“http://schemas.datacontract.org/2004/07/Csla.Server”中的“_principal”并非所需元素。所需元素应为“m_identity”。”。有关详细信息,请参见 InnerException。

 

http://forums.lhotka.net/forums/p/10794/50345.aspx 参见此页面中JonnyBee 的回复.

大意应该是要修改认证方式,所以我把Csla项目中做了一个改动.

修改了Csla/DataPortal中的security方法 

private static System.Security.Principal.IPrincipal GetPrincipal()

    {

      if (ApplicationContext.AuthenticationType == "Windows")

      {

        // Windows integrated security

        return null;

      }

      else

      {

        // we assume using the CSLA framework security

      //  return ApplicationContext.User;//原方法 

 

        return new Csla.Security.UnauthenticatedPrincipal();

      }

    }

修改后不知道有什么其他影响

暂时可以讲程序通过运行.

 

 

 

posted @ 2012-04-19 15:22  wccc  阅读(628)  评论(0编辑  收藏  举报