C# Google Checkout突然返回:';GCheckout.XmlSerializers';未能加载';

C# Google Checkout突然返回:';GCheckout.XmlSerializers';未能加载';,c#,serialization,google-checkout,C#,Serialization,Google Checkout,我突然在使用Google Checkout ASP.NET控件“GCheckout”时遇到间歇性错误 它位于代码的第一行,如下所示: XmlSerializer Ser = new XmlSerializer(ObjectToSerialize.GetType()); //ObjectToSerialize is a CheckoutShoppingCart object 让我困惑的是,为什么它以前似乎一直工作,而现在只是间歇性地返回下面显示的错误 这个库对我来说是一个巨大的黑匣子,我是一个

我突然在使用Google Checkout ASP.NET控件“GCheckout”时遇到间歇性错误

它位于代码的第一行,如下所示:

 XmlSerializer Ser = new XmlSerializer(ObjectToSerialize.GetType()); //ObjectToSerialize is a CheckoutShoppingCart object
让我困惑的是,为什么它以前似乎一直工作,而现在只是间歇性地返回下面显示的错误

这个库对我来说是一个巨大的黑匣子,我是一个VB.NET的人,而不是C

有人能提供一些建议吗

/// <summary>
/// Makes XML out of an object.
/// </summary>
/// <param name="ObjectToSerialize">The object to serialize.</param>
/// <returns>An XML string representing the object.</returns>
/// <example>
/// <code>
/// Car MyCar1 = new Car();
/// byte[] CarBytes = EncodeHelper.Serialize(MyCar1);
/// string CarXml = EncodeHelper.Utf8BytesToString(CarBytes);
/// Car MyCar2 = (Car) Deserialize(CarXml, typeof(Car));
/// // MyCar2 is now a copy of MyCar1.
/// </code>
/// </example>
public static byte[] Serialize(object ObjectToSerialize) {
  XmlSerializer Ser = new XmlSerializer(ObjectToSerialize.GetType()); //ObjectToSerialize is a CheckoutShoppingCart object
  using (MemoryStream MS = new MemoryStream()) {
    XmlTextWriter W = new XmlTextWriter(MS, new UTF8Encoding(false));
    W.Formatting = Formatting.Indented;
    Ser.Serialize(W, ObjectToSerialize);
    W.Flush();
    W.Close();
    return MS.ToArray();
  }
}

The assembly with display name 'GCheckout.XmlSerializers' failed to load in the 'LoadFrom' binding context of the AppDomain with ID 9. The cause of the failure was: System.IO.FileNotFoundException: Could not load file or assembly 'GCheckout.XmlSerializers, Version=1.3.2.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
File name: 'GCheckout.XmlSerializers, Version=1.3.2.0, Culture=neutral, PublicKeyToken=null'

=== Pre-bind state information ===
LOG: User = NA\MYNAME
LOG: DisplayName = GCheckout.XmlSerializers, Version=1.3.2.0, Culture=neutral, PublicKeyToken=null, processorArchitecture=MSIL
 (Fully-specified)
LOG: Appbase = file:///C:/My/Code/BESI/BESI/
LOG: Initial PrivatePath = C:\My\Code\BESI\BESI\bin
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\My\Code\BESI\BESI\web.config
LOG: Using machine configuration file from C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files/besi/c1115671/77c4386d/GCheckout.XmlSerializers.DLL.
LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files/besi/c1115671/77c4386d/GCheckout.XmlSerializers/GCheckout.XmlSerializers.DLL.
LOG: Attempting download of new URL file:///C:/My/Code/BESI/BESI/bin/GCheckout.XmlSerializers.DLL.
LOG: Attempting download of new URL file:///C:/My/Code/BESI/BESI/bin/GCheckout.XmlSerializers/GCheckout.XmlSerializers.DLL.
LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files/besi/c1115671/77c4386d/GCheckout.XmlSerializers.EXE.
LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files/besi/c1115671/77c4386d/GCheckout.XmlSerializers/GCheckout.XmlSerializers.EXE.
LOG: Attempting download of new URL file:///C:/My/Code/BESI/BESI/bin/GCheckout.XmlSerializers.EXE.
LOG: Attempting download of new URL file:///C:/My/Code/BESI/BESI/bin/GCheckout.XmlSerializers/GCheckout.XmlSerializers.EXE.

这是XML序列化的正常例外。调试+异常,关闭复选框。使用预编译序列化程序集,速度要快得多。

这是XML序列化的正常例外。调试+异常,关闭复选框。使用预编译序列化程序集,速度要快得多