Today, an error message is displayed for all the Web parts on the customer's site:
Web part error: one of the properties of the Web part has an incorrect format. Windows SharePoint Services cannot deserialize the Web part. Check the format of the properties and try again.
Finally, it is solved by assigning necessary permissions to the % Temp % folder.
What is the permission? A: The process account must have the read, write, and delete permissions. Information Source: building secure ASP. NET Applications: authentication, authorization, and secure communication
For more details, why does % Temp % affect the Web part display in ASP. NET?
% SystemRoot % \ Microsoft. net \ framework \ versionnumber \ temporary ASP. net Files folder, Which is ASP. NET Dynamic compilation. for more information, see Understanding ASP. NET Dynamic compilation. but this is not the folder pointed to by % Temp %.
Google, found that the % Temp % folder is the proxy (proxies) required for serialization generated by Web Services. it is no wonder that the Web part cannot be deserialized in the error message. information Source: building secure ASP. net Applications: authentication, authorization, and secure communication.
Original article: this is the location used by web services to generate serialization proxies.
So what is serialization?
Serialization can be defined as the process of storing the state of an object instance to a storage medium. during this process, the public and private fields of the object and the name of the class, including the Assembly containing the class, is converted to a stream of bytes, which is then written to a data stream. when the object is subsequently deserialized, an exact clone of the original object is created.
The Common Language Runtime (CLR) manages how objects are laid out in memory and the. NET Framework provides an automatic serialization mechanism by using reflection.
Objects often store references to other instances in member variables. when the class is serialized, the serialization engine keeps track of all referenced objects already serialized to ensure that the same object is not serialized more than once.
The only requirement placed on Object graphs is that all objects referenced by the object that is being serialized must also be markedSerializable(See Basic serialization). If this is not done, an exception will be thrown when the serializer attempts to serialize the unmarked object.
Objects are only valid in the application domain where they are created. Any attempt to pass the object as a parameter or return it as a result will fail unless the object derives fromMarshalbyrefobjectOr is markedSerializable. If the object is markedSerializable, The object will automatically be serialized, transported from the one application domain to the other, and then deserialized to produce an exact copy of the object in the second application domain. this process is typically referred to as marshal by value.
Note:The following section introduces proxy.
When an object derives fromMarshalbyrefobject, An object reference will be passed from one application domain to another, rather than the object itself. You can also mark an object that derives fromMarshalbyrefobjectAsSerializable. When this object is used with remoting, The formatter responsible for serialization, which has been preconfigured withSurrogateselectorTakes control of the serialization process and replaces all objects derived fromMarshalbyrefobjectWith a proxy.
It is important to note thatSerializableAttribute cannot be inherited. If we derive a new class fromMyobject, The new class must be marked with the attribute as well, or it cannot be serialized.
The above content comes from object serialization in the. NET Framework
the process of integrating the above information should be like this, Asp. net generates a webpart. Because webpart is valid only in the appdomain where it is created, it must be serialized when it is passed to the WSS service. serialization requires the WSS service to generate a serialization proxy. The generated location is in % Temp % of the system environment variable. The default value is c: \ windows \ temp. if the account running the process does not have the read/write permission for this folder, the above error is reported.