MultiUpload (without flash) on webfarm

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

MultiUpload (without flash) on webfarm

Guest-982
Hi Dean, When on a web farm using SQL Session state we are getting the error below. We are in a multi-server environment and thus need the SQL Session state and thus the "Reducing Server Load" fix doesn't seem to apply. Our customer has asked that we don't use flash. Is there any way around this issue? Server Error in '/blah' Application. -------------------------------------------------------------------------------- Type 'System.IO.FileStream' in Assembly 'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' is not marked as serializable. 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 'System.IO.FileStream' in Assembly 'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' is not marked as serializable. Source Error: Line 377: { Line 378: LosFormatter scFormatter = new LosFormatter(); Line 379: scFormatter.Serialize(s, Obj); Line 380: } Line 381: Source File: C:\Sources\LocalGovernment\Source_EBC\eConsents\Features\PostJuly1\Source\NeatUpload\Brettle.Web.NeatUpload\ObjectProtector.cs Line: 379 Stack Trace: [SerializationException: Type 'System.IO.FileStream' in Assembly 'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' 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.Write(WriteObjectInfo objectInfo, NameInfo memberNameInfo, NameInfo typeNameInfo) +7631620 System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(Object graph, Header[] inHeaders, __BinaryWriter serWriter, Boolean fCheck) +461 System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph, Header[] headers, Boolean fCheck) +134 System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph) +13 System.Web.UI.ObjectStateFormatter.SerializeValue(SerializerBinaryWriter writer, Object value) +845 [ArgumentException: Error serializing value 'Brettle.Web.NeatUpload.UploadState' of type 'Brettle.Web.NeatUpload.UploadState.'] System.Web.UI.ObjectStateFormatter.SerializeValue(SerializerBinaryWriter writer, Object value) +3395 System.Web.UI.ObjectStateFormatter.Serialize(Stream outputStream, Object stateGraph) +110 System.Web.UI.ObjectStateFormatter.Serialize(Object stateGraph) +57 System.Web.UI.LosFormatter.SerializeInternal(TextWriter output, Object value) +20 System.Web.UI.LosFormatter.Serialize(Stream stream, Object value) +43 Brettle.Web.NeatUpload.SelfSerializingObject.Serialize(Stream s) in C:\Sources\LocalGovernment\Source_EBC\eConsents\Features\PostJuly1\Source\NeatUpload\Brettle.Web.NeatUpload\ObjectProtector.cs:379 Brettle.Web.NeatUpload.ObjectProtector.Protect(Serializer serializer, Byte[] encryptionKey, Byte[] unused, String encryptionAlgorithm, String validationAlgorithm) in C:\Sources\LocalGovernment\Source_EBC\eConsents\Features\PostJuly1\Source\NeatUpload\Brettle.Web.NeatUpload\ObjectProtector.cs:319 Brettle.Web.NeatUpload.ObjectProtector.Protect(Object objectToSerialize, Byte[] encryptionKey, Byte[] validationKey, String encryptionAlgorithm, String validationAlgorithm) in C:\Sources\LocalGovernment\Source_EBC\eConsents\Features\PostJuly1\Source\NeatUpload\Brettle.Web.NeatUpload\ObjectProtector.cs:194 Brettle.Web.NeatUpload.SimpleWebRemoting.MakeRemoteCall(Uri uri, HttpCookieCollection httpCookies, Byte[] encryptionKey, Byte[] validationKey, String encryptionAlgorithm, String validationAlgorithm, Object[] methodCall) in C:\Sources\LocalGovernment\Source_EBC\eConsents\Features\PostJuly1\Source\NeatUpload\Brettle.Web.NeatUpload\SimpleWebRemoting.cs:105 Brettle.Web.NeatUpload.SimpleWebRemoting.MakeRemoteCall(Uri uri, Object[] methodCall) in C:\Sources\LocalGovernment\Source_EBC\eConsents\Features\PostJuly1\Source\NeatUpload\Brettle.Web.NeatUpload\SimpleWebRemoting.cs:60 Brettle.Web.NeatUpload.SessionBasedUploadStateStoreProvider.MakeRemoteCall(Object[] methodCall) in C:\Sources\LocalGovernment\Source_EBC\eConsents\Features\PostJuly1\Source\NeatUpload\Brettle.Web.NeatUpload\SessionBasedUploadStateStoreProvider.cs:100 Brettle.Web.NeatUpload.SessionBasedUploadStateStoreProvider.MergeAndSave(UploadState uploadState) in C:\Sources\LocalGovernment\Source_EBC\eConsents\Features\PostJuly1\Source\NeatUpload\Brettle.Web.NeatUpload\SessionBasedUploadStateStoreProvider.cs:74 Brettle.Web.NeatUpload.AdaptiveUploadStateStoreProvider.MergeAndSave(UploadState uploadState) in C:\Sources\LocalGovernment\Source_EBC\eConsents\Features\PostJuly1\Source\NeatUpload\Brettle.Web.NeatUpload\AdaptiveUploadStateStoreProvider.cs:90 Brettle.Web.NeatUpload.UploadStateStore.MergeAndSave(UploadState uploadState) in C:\Sources\LocalGovernment\Source_EBC\eConsents\Features\PostJuly1\Source\NeatUpload\Brettle.Web.NeatUpload\UploadStateStore.cs:202 Brettle.Web.NeatUpload.UploadStateStore.UploadState_Changed(Object sender, EventArgs args) in C:\Sources\LocalGovernment\Source_EBC\eConsents\Features\PostJuly1\Source\NeatUpload\Brettle.Web.NeatUpload\UploadStateStore.cs:195 Brettle.Web.NeatUpload.UploadState.OnChanged() in C:\Sources\LocalGovernment\Source_EBC\eConsents\Features\PostJuly1\Source\NeatUpload\Brettle.Web.NeatUpload\UploadState.cs:351 Brettle.Web.NeatUpload.UploadState.set_Status(UploadStatus value) in C:\Sources\LocalGovernment\Source_EBC\eConsents\Features\PostJuly1\Source\NeatUpload\Brettle.Web.NeatUpload\UploadState.cs:97 Brettle.Web.NeatUpload.UploadHttpModule.Application_EndRequest(Object sender, EventArgs e) in C:\Sources\LocalGovernment\Source_EBC\eConsents\Features\PostJuly1\Source\NeatUpload\Brettle.Web.NeatUpload\UploadHttpModule.cs:833 System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +68 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75 -------------------------------------------------------------------------------- Version Information: Microsoft .NET Framework Version:2.0.50727.3082; ASP.NET Version:2.0.50727.3082
Reply | Threaded
Open this post in threaded view
|

Re: MultiUpload (without flash) on webfarm

Dean Brettle
Administrator
What version of NeatUpload are you using?

--Dean
Reply | Threaded
Open this post in threaded view
|

Re: MultiUpload (without flash) on webfarm

Dean Brettle
Administrator
FWIW, I think this is probably a bug.  Are you accessing UploadedFile.InputStream from somewhere in your code?  If so, can you workaround the issue by using the stream returned by UploadedFile.OpenRead() instead?  Alternatively, you could try changing:

private Stream _InputStream;

to:

[NonSerialized]
private Stream _InputStream;

at the bottom of NeatUpload-version/dotnet/src/Brettle.Web.NeatUpload/Brettle.Web.NeatUpload/UploadedFile.cs.

Please let me know what you try and and what works. 
Thanks,
--Dean
Reply | Threaded
Open this post in threaded view
|

Re: MultiUpload (without flash) on webfarm

Guest-982
Hi Dean, I searched and found the place where we were indead using UploadedFile.InputStream and changed it to OpenRead() which has solved the problem as you thought. As an added insurance to insure against future changes to our code I also marked the _InputStream as NonSerialized so that at least the bug will be reported in our code rather than in the upload component. We are using version 3.1.13, with some minor tweaks, like to remove the branding, and some minor changes in the JS to help solve, I think unsuccessfully, some crossbrowser display problems we were having. Thanks David.
Reply | Threaded
Open this post in threaded view
|

Re: MultiUpload (without flash) on webfarm

Dean Brettle
Administrator
Thanks for the feedback.  The [NonSerialized] fix will be in the next release.  If you are experience browser compatibility issues please report them in a separate thread when you get a chance.

Thanks,
--Dean