Index: /trunk/sources/HeuristicLab.Persistence/3.3/Core/Serializer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Persistence/3.3/Core/Serializer.cs	(revision 6445)
+++ /trunk/sources/HeuristicLab.Persistence/3.3/Core/Serializer.cs	(revision 6446)
@@ -246,5 +246,5 @@
             compositeSerializer.CreateMetaInfo(value),
             emitTypeInfo);
-        throw CreatePersistenceException(type, "Could not determine how to serialize a value.");
+        throw CreatePersistenceException(type, "Could not determine how to serialize a value.", true);
       }
       catch (Exception x) {
@@ -255,5 +255,8 @@
           throw;
         } else {
-          throw CreatePersistenceException(type, "Uncaught exception during serialization: " + x.Message);
+          throw CreatePersistenceException(
+            type,
+            string.Format("Uncaught exception during serialization:{0}{1}", Environment.NewLine, x),
+            false);
         }
       }
@@ -261,7 +264,7 @@
         objectGraphTrace.Pop();
       }
-    }
-
-    private PersistenceException CreatePersistenceException(Type type, string message) {
+    }    
+
+    private PersistenceException CreatePersistenceException(Type type, string message, bool appendConfig) {
       StringBuilder sb = new StringBuilder();
       sb.Append(message)
@@ -270,18 +273,20 @@
         .AppendLine("\"")
         .Append("object graph location: ")
-        .AppendLine(string.Join(".", objectGraphTrace.ToArray()))
-        .AppendLine("No registered primitive serializer for this type:");
-      foreach (var ps in configuration.PrimitiveSerializers)
-        sb.Append(ps.SourceType.VersionInvariantName())
-          .Append(" ---- (")
-          .Append(ps.GetType().VersionInvariantName())
-          .AppendLine(")");
-      sb.AppendLine("Rejected by all composite serializers:");
-      foreach (var cs in configuration.CompositeSerializers)
-        sb.Append("\"")
-          .Append(cs.JustifyRejection(type))
-          .Append("\" ---- (")
-          .Append(cs.GetType().VersionInvariantName())
-          .AppendLine(")");
+        .AppendLine(string.Join(".", objectGraphTrace.ToArray()));
+      if (appendConfig) {
+        sb.AppendLine("No registered primitive serializer for this type:");
+        foreach (var ps in configuration.PrimitiveSerializers)
+          sb.Append(ps.SourceType.VersionInvariantName())
+            .Append(" ---- (")
+            .Append(ps.GetType().VersionInvariantName())
+            .AppendLine(")");
+        sb.AppendLine("Rejected by all composite serializers:");
+        foreach (var cs in configuration.CompositeSerializers)
+          sb.Append("\"")
+            .Append(cs.JustifyRejection(type))
+            .Append("\" ---- (")
+            .Append(cs.GetType().VersionInvariantName())
+            .AppendLine(")");
+      }
       return new PersistenceException(sb.ToString());
     }
Index: /trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/System.Drawing/Bitmap2XmlSerializer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/System.Drawing/Bitmap2XmlSerializer.cs	(revision 6445)
+++ /trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/System.Drawing/Bitmap2XmlSerializer.cs	(revision 6446)
@@ -28,7 +28,8 @@
   internal sealed class Bitmap2XmlSerializer : PrimitiveXmlSerializerBase<Bitmap> {
 
-    public override XmlString Format(Bitmap o) {
+    public override XmlString Format(Bitmap o) {      
       MemoryStream stream = new MemoryStream();
-      o.Save(stream, ImageFormat.Png);
+      lock (o)
+        o.Save(stream, ImageFormat.Png);
       byte[] array = stream.ToArray();
       Byte1DArray2XmlSerializer serializer = new Byte1DArray2XmlSerializer();
Index: /trunk/sources/HeuristicLab.Persistence/3.3/Tests/UseCases.cs
===================================================================
--- /trunk/sources/HeuristicLab.Persistence/3.3/Tests/UseCases.cs	(revision 6445)
+++ /trunk/sources/HeuristicLab.Persistence/3.3/Tests/UseCases.cs	(revision 6446)
@@ -1289,4 +1289,26 @@
     }
 
+    [TestMethod]
+    public void ConcurrentBitmapTest() {
+      Bitmap b = new Bitmap(300, 300);
+      Random r = new Random();
+      for (int x = 0; x<b.Height; x++) {
+        for (int y = 0; y<b.Width; y++) {
+          b.SetPixel(x, y, Color.FromArgb(r.Next()));
+        }
+      }
+      Task[] tasks = new Task[20];
+      byte[][] datas = new byte[tasks.Length][];
+      for (int i = 0; i<tasks.Length; i++) {
+        tasks[i] = Task.Factory.StartNew((idx) => {
+          using (var stream = new MemoryStream()) {
+            XmlGenerator.Serialize(b, stream);
+            datas[(int)idx] = stream.ToArray();
+          }
+        }, i);
+      }
+      Task.WaitAll(tasks);
+    }
+
     [ClassInitialize]
     public static void Initialize(TestContext testContext) {
