Server Error in '/' Application.

[A]System.Collections.Generic.List`1[ShoppingCart] cannot be cast to [B]System.Collections.Generic.List`1[ShoppingCart]. Type A originates from 'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' in the context 'LoadNeither' at location 'C:\Windows\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll'. Type B originates from 'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' in the context 'LoadNeither' at location 'C:\Windows\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll'.

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.InvalidCastException: [A]System.Collections.Generic.List`1[ShoppingCart] cannot be cast to [B]System.Collections.Generic.List`1[ShoppingCart]. Type A originates from 'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' in the context 'LoadNeither' at location 'C:\Windows\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll'. Type B originates from 'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' in the context 'LoadNeither' at location 'C:\Windows\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll'.

Source Error:


Line 27:     {
Line 28:         List<ShoppingCart> lst = new List<ShoppingCart>();
Line 29:         lst = (List<ShoppingCart>)Session["Cart"];
Line 30:         if (lst.Count <= 0)
Line 31:         {

Source File: c:\inetpub\vhosts\vattucongnghiep.com.vn\httpdocs\ShopCart.aspx.cs    Line: 29

Stack Trace:


[InvalidCastException: [A]System.Collections.Generic.List`1[ShoppingCart] cannot be cast to [B]System.Collections.Generic.List`1[ShoppingCart]. Type A originates from 'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' in the context 'LoadNeither' at location 'C:\Windows\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll'. Type B originates from 'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' in the context 'LoadNeither' at location 'C:\Windows\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll'.]
   ShopCart.ShowCart() in c:\inetpub\vhosts\vattucongnghiep.com.vn\httpdocs\ShopCart.aspx.cs:29
   ShopCart.Page_Load(Object sender, EventArgs e) in c:\inetpub\vhosts\vattucongnghiep.com.vn\httpdocs\ShopCart.aspx.cs:17
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627


Version Information: Microsoft .NET Framework Version:2.0.50727.8800; ASP.NET Version:2.0.50727.8762