title: Compiler Issue in Windows 7: A generic error occurred in GDI+
body: <p>We have an application that we need to begin testing and developing in Windows 7 environment. It works fine compiling under WinXP in VS2008, no problems. However when I went to compile it on a windows 7 machine using VS2008 today I get the following error:</p>
  
  <pre><code>    Error   12  The "GenerateResource" task failed unexpectedly.
  System.Runtime.InteropServices.ExternalException (0x80004005): A generic error occurred in GDI+.
     at System.Drawing.Image.Save(Stream stream, ImageCodecInfo encoder, EncoderParameters encoderParams)
     at System.Drawing.Image.Save(MemoryStream stream)
     at System.Drawing.Image.System.Runtime.Serialization.ISerializable.GetObjectData(SerializationInfo si, StreamingContext context)
     at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter, SerializationBinder binder)
     at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.Serialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter, SerializationBinder binder)
     at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(Object graph, Header[] inHeaders, __BinaryWriter serWriter, Boolean fCheck)
     at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph, Header[] headers, Boolean fCheck)
     at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph)
     at System.Resources.ResourceWriter.WriteValue(ResourceTypeCode typeCode, Object value, BinaryWriter writer, IFormatter objFormatter)
     at System.Resources.ResourceWriter.Generate()
     at System.Resources.ResourceWriter.Dispose(Boolean disposing)
     at System.Resources.ResourceWriter.Close()
     at Microsoft.Build.Tasks.ProcessResourceFiles.WriteResources(IResourceWriter writer)
     at Microsoft.Build.Tasks.ProcessResourceFiles.WriteResources(String filename)
     at Microsoft.Build.Tasks.ProcessResourceFiles.ProcessFile(String inFile, String outFile)
     at Microsoft.Build.Tasks.ProcessResourceFiles.Run(TaskLoggingHelper log, ITaskItem[] assemblyFilesList, List`1 inputs, List`1 outputs, Boolean sourcePath, String language, String namespacename, String resourcesNamespace, String filename, String classname, Boolean publicClass)
     at Microsoft.Build.Tasks.ProcessResourceFiles.Run(TaskLoggingHelper log, ITaskItem[] assemblyFilesList, List`1 inputs, List`1 outputs, Boolean sourcePath, String language, String namespacename, String resourcesNamespace, String filename, String classname, Boolean publicClass)
     at Microsoft.Build.Tasks.GenerateResource.Execute()
     at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
     at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask, Boolean&amp; taskResult)
  </code></pre>
  
  <p>I cannot for the life of me run this one down. I have visited the msdn forums and find that it is an issue for a lot of people, but no consistent solution has been provided by MS or anyone else.</p>
  
  <p>Has anyone seen this before and fixed it? Please advise is needed!</p>
  
  <p>Thanks</p>