the following error is throwing while uploading an image in the website I am using a sessionState for sqlServer mode in my web.config.If i remove session state its working fine.But when i keep the sessionstate in my web.config
do any one faced this problem before.Please let me know.
ex:

Thanks,
Prasant

Badha ChanduPosted Jan 27, 2017, 4:00 AM
Badha ChanduPosted Jan 25, 2017, 8:46 AM
Akkiraju IvaturiPosted Sep 4, 2012, 4:33 PM
The problem lies with a configuration difference in IIS between your local machine and that of your web server.
Since you are handling session using stateserver as SQL Server in order to transfer the data to the database server IIS serializes your session information to send to another server. Basically this takes all the details for a given object and converts them to XML so that the object can be saved and loaded into memory as needed.
The problem in your case is that 'System.Web.HttpPostedFileWrapper' class do not support serialization. Usually this problem occurs with classes written by developers and we can just add attribute [Serializable] to solve the issue. Since, this is something provided by .NET framework you do not have any work around. You may have to write your own class for the purpose or do not use this one.
My suggestion is to look for work around by not using this one.
Sukesh MarlaPosted Sep 4, 2012, 12:51 PM
Prasant JinagaPosted Sep 4, 2012, 12:31 PM
I have already tried that.still it didn't work
Thanks,
Prasant
Sukesh MarlaPosted Sep 4, 2012, 11:53 AM
example
[Serializable]
public class A
{
..........
.......
}
A a =new A();
.........
Sessiion["asdasdsa"]=a;
Check this is correct answer if it helped.