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 29:     {
Line 30:         List<ShoppingCart> lst = new List<ShoppingCart>();
Line 31:         lst = (List<ShoppingCart>)Session["Cart"];
Line 32:         if (lst.Count <= 0)
Line 33:         {

Source File: c:\inetpub\vhosts\kiengiangcomputer.com\httpdocs\ShopCart.aspx.cs    Line: 31

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\kiengiangcomputer.com\httpdocs\ShopCart.aspx.cs:31
   ShopCart.Page_Load(Object sender, EventArgs e) in c:\inetpub\vhosts\kiengiangcomputer.com\httpdocs\ShopCart.aspx.cs:18
   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