日期:2014-05-17  浏览次数:21272 次

"未解析成员"错误
我在学习Csla的时侯,测试它给的一个WEB例子出现下列错误,但发布后又没有错误了(都使用的是WCF访问模式),在同样的条件下测试其windows Forms例子没有任何错误。

--------------
未解析成员“Csla.Security.UnauthenticatedPrincipal,Csla, Version=3.6.2.0, Culture=neutral, PublicKeyToken=93be5fdc093e4c30”的类型。 
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 

异常详细信息: System.Runtime.Serialization.SerializationException: 未解析成员“Csla.Security.UnauthenticatedPrincipal,Csla, Version=3.6.2.0, Culture=neutral, PublicKeyToken=93be5fdc093e4c30”的类型。

源错误: 

执行当前 Web 请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。  
------------------

在CSDN上有一个类似的问题,但没有明确的解决方案。我能想到的方法都试过,没有改善。

例子是在http://www.lhotka.net/cslanet.下载的,Version=3.6.2.0
------解决方案--------------------
试试这个:
http://forums.lhotka.net/forums/t/157.aspx


PTWeb uses a custom principal, so you must run it in IIS, not in the development web server.

To do that

Add a virtual root in IIS that points to the PTWeb directory 
Change the web project's properties in VS so the startup option runs from a custom web server (often http://localhost/ptweb)
It is also the case that PTWeb needs to talk to the database. By default ASP.NET apps don't have security to talk to the database. So you have two options: configure the database to accept direct ASP.NET calls, or configure the data portal to use a remote host (remoting, enteprrise services, etc).

Of those two options, the simplest is typically to configure the data portal to use a remote host. In version 3.0 and higher the configuration defaults to using WCF and so it should just work. In 2.1 and earlier the download uses EnterpriseServices because that's easiest - only requiring that you register that one assembly with COM+.

But the exception you are getting is NOT a database access or dataportal access exception. So your problem is, almost certainly, that you don't have PTWeb running in IIS.


------解决方案--------------------
没有引用
Csla.Security.UnauthenticatedPrincipal
所在的库吧
------解决方案--------------------
吧Csla相关dll放到bin中。
------解决方案--------------------
应该是缺少相关的dll
------解决方案--------------------
你看一下你下的那个版本和.net framework的版本是否对应的,他里面不是有对应的列表嘛
------解决方案--------------------
没有编译成功或者没有添加引用。
把所有的临时文件夹删除再进行
------解决方案--------------------
他们说可以在IIS里面运行,但不能在VS的 development web server 里面运行啊,你要部署到iis里面看效果,
------解决方案--------------------