日期:2014-05-18  浏览次数:20458 次

求教,asp.net mvc3使用CAS单点认证报错。
登录的时候能跳转到服务端的地址
C# code

        [Authorize]
        public ActionResult Login()
        {
            return View();
        }


登录后能获取到票据,
在服务端地址登录后返回view出现如下错误,
Server Error in '/' Application.
Type is not resolved for member 'DotNetCasClient.Security.CasPrincipal,DotNetCasClient, Version=0.0.0.0, Culture=neutral, PublicKeyToken=bb0f1feb6ffbaa19'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Runtime.Serialization.SerializationException: Type is not resolved for member 'DotNetCasClient.Security.CasPrincipal,DotNetCasClient, Version=0.0.0.0, Culture=neutral, PublicKeyToken=bb0f1feb6ffbaa19'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[SerializationException: Type is not resolved for member 'DotNetCasClient.Security.CasPrincipal,DotNetCasClient, Version=0.0.0.0, Culture=neutral, PublicKeyToken=bb0f1feb6ffbaa19'.]
  Microsoft.VisualStudio.WebHost.Connection.get_RemoteIP() +0
  Microsoft.VisualStudio.WebHost.Request.GetRemoteAddress() +65
  System.Web.HttpRequest.get_IsLocal() +23
  System.Web.Configuration.CustomErrorsSection.CustomErrorsEnabled(HttpRequest request) +86
  System.Web.HttpContextWrapper.get_IsCustomErrorEnabled() +45
  System.Web.Mvc.HandleErrorAttribute.OnException(ExceptionContext filterContext) +72
  System.Web.Mvc.ControllerActionInvoker.InvokeExceptionFilters(ControllerContext controllerContext, IList`1 filters, Exception exception) +115
  System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +323
  System.Web.Mvc.Controller.ExecuteCore() +116
  System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +97
  System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +10
  System.Web.Mvc.<>c__DisplayClassb.<BeginProcessRequest>b__5() +37
  System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +21
  System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +12
  System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
  System.Web.Mvc.<>c__DisplayClasse.<EndProcessRequest>b__d() +50
  System.Web.Mvc.SecurityUtil.<GetCallInAppTrustThunk>b__0(Action f) +7
  System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Action action) +22
  System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +60
  System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
  System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8969117
  System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +184
=============================================================================================================
登出的时候客户端会报异常,服务端都会出现警告。
C# code

        public ActionResult LoginOut()
        {
            CasAuthentication.SingleSignOut();
            return RedirectToAction("Index", "Home");
        }