Security Note
When using this method it is guaranteed that no new assembly is loaded during the deserialization.
To allow loading assemblies or to use a custom ITypeResolutionService use the GetValue method instead.
public Object? GetValueSafe(
bool cleanupRawData = false
)
Public Function GetValueSafe (
Optional cleanupRawData As Boolean = false
) As Object
public:
Object^ GetValueSafe(
bool cleanupRawData = false
)
member GetValueSafe :
?cleanupRawData : bool
(* Defaults:
let _cleanupRawData = defaultArg cleanupRawData false
*)
-> Object
If the stored value currently exists in memory, it is returned directly.
If the resource is a file reference and is has not been deserialized yet, then this method throws a NotSupportedException. You can only use the GetValue method to deserialize a file reference.
TypeLoadException | The corresponding type or its container assembly could not be loaded. |
SerializationException | An error occurred during the binary deserialization of the resource. |
FileNotFoundException | The resource is a file reference and the referenced file cannot be found. |
NotSupportedException | Unsupported MIME type or an appropriate type converter is not available.
-or- The value has not been deserialized yet and FileRef is not . |