私はeコマースASP.NET(c#コードビハインド)Webアプリケーションを継承しました。私たちは最近サーバーを移動しましたが、いくらか面倒です。私は、IISサーバー構成の経験はほとんどなく、このような大きなプロジェクトを扱っています。問題の大半は修正されましたが、顧客が支払いを試みる際に重大な問題を抱えています。コンパイルされたDLLのシリアライゼーション例外
Unable to serialize the session state. In 'StateServer' and 'SQLServer' mode, ASP.NET
will serialize the session state objects, and as a result non-serializable objects or
MarshalByRef objects are not permitted. The same restriction applies if similar
serialization is done by the custom session state store in 'Custom' mode.
スタックトレース:顧客が支払いを確認したよう
は、アプリケーションが次のエラーが発生した
[SerializationException: Type 'PayerAuthentication.PayerAuthenticationServicePost' in Assembly 'PayerAuthentication, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' is not marked as serializable.]
System.Runtime.Serialization.FormatterServices.InternalGetSerializableMembers(RuntimeType type) +7733643
System.Runtime.Serialization.FormatterServices.GetSerializableMembers(Type type, StreamingContext context) +258
System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitMemberInfo() +111
System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter) +161
System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.Serialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter) +51
System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(Object graph, Header[] inHeaders, __BinaryWriter serWriter, Boolean fCheck) +410
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph, Header[] headers, Boolean fCheck) +134
System.Web.Util.AltSerialization.WriteValueToStream(Object value, BinaryWriter writer) +1577
Googleの検索結果は、私が影響を受けたクラス宣言に[Serializable]
を追加する必要があることを示すが、これはです私はcsprojを持っていないコンパイルされたDLLです。 コードは以前のサーバーで正常に動作していましたが、コードに変更が加えられているとは思われません。web.configのみ - 何ができますか?
web.configファイルのてsessionStateセクションがUPDATE1<sessionState mode="StateServer" />
を読み取ります。リフレクターを使用して、私は、上記のクラスをエクスポートし、それは、シリアライズ作られ、再コンパイルしてDLLを置き換えます。注文処理は一歩進んで、別のdllコンパイルされたクラスに対して同じエラーが発生しました。もう一度私はReflectorを使ってコードを見てからエクスポートし、編集して再コンパイルすることができました。
は今、私は中に発生した同じエラーを持っている:
SerializationException: Type 'System.Runtime.Remoting.Messaging.AsyncResult' in Assembly 'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' is not marked as serializable.]
これは、.NETシステムファイルの一部でなければならないとして、私は、私はこれについて何かを行うことができますかわかりません!その他のアイデアは?
はアップデート2:ハは、よく私はその後、それが正しく支払いを処理するが、ユーザがトランザクションの領収書を取得する前に、次にSystem.Runtime.Remoting.Messaging.AsyncResult
に上記Unable to serialize the session state
エラーを投げ発見しました。良くない。 ...今、前方に移動する方法がわからない
Update3と:私はSystem.Runtime.Remoting.Messaging.AsyncResult
クラスのコピーを作成し、それは、シリアライズすることが、これはその後、一貫性のないアクセシビリティの問題につながっているしようとしました。
using System;
using System.Runtime.InteropServices;
using System.Threading;
using System.Security.Permissions;
using System.Runtime.Remoting.Messaging;
[Serializable, ComVisible(true)]
public class myAsyncResult : IAsyncResult, IMessageSink
{
// Fields
private AsyncCallback _acbd;
private Delegate _asyncDelegate;
private object _asyncState;
private ManualResetEvent _AsyncWaitHandle;
private bool _endInvokeCalled;
private bool _isCompleted;
private IMessageCtrl _mc;
private IMessage _replyMsg;
// Methods
internal myAsyncResult(Message m);
//[SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.Infrastructure)]
public virtual IMessageCtrl AsyncProcessMessage(IMessage msg, IMessageSink replySink);
private void FaultInWaitHandle();
public virtual IMessage GetReplyMessage();
public virtual void SetMessageCtrl(IMessageCtrl mc);
//[SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.Infrastructure)]
public virtual IMessage SyncProcessMessage(IMessage msg);
// Properties
public virtual object AsyncDelegate { get; }
public virtual object AsyncState { get; }
public virtual WaitHandle AsyncWaitHandle { get; }
public virtual bool CompletedSynchronously { get; }
public bool EndInvokeCalled { get; set; }
public virtual bool IsCompleted { get; }
public IMessageSink NextSink { [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.Infrastructure)] get; }
}
具体的には、error CS0122: 'System.Runtime.Remoting.Messaging.Message' is inaccessible due to its protection level
である。 Messageは内部クラスなので、これがわかります。しかし、確かに、System.Runtime名前空間の一部であるため、アクセシビリティレベルを変更することはできません。コピーを作成して名前を変更すると、同じ問題が再び発生します。
誰でも今私を助けることができますか?
FINAL UPDATE は、SSL証明書であったことを、すべてこの後、のように見える(下の私の答えを参照)
web.configの
bperreault