添加图像会导致GenerateResource错误

时间:2013-06-08 04:00:18

标签: .net visual-studio-2010 visual-studio frameworks resources

我正在使用Visual Basic 2010中的背景图像,并在第一次尝试期间成功调试了该程序。但是,在使用我的资源试验一些图像后,我的项目搞砸了这个错误:

  

错误1“GenerateResource”任务意外失败。   System.Runtime.InteropServices.ExternalException(0x80004005):A   GDI +中发生了一般错误。在System.Drawing.Image.Save(Stream   stream,ImageCodecInfo encoder,EncoderParameters encoderParams)at   System.Drawing.Image.Save(MemoryStream流)at   System.Drawing.Image.System.Runtime.Serialization.ISerializable.GetObjectData(的SerializationInfo   si,StreamingContext context)at   System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(对象   obj,ISurrogateSelector surrogateSelector,StreamingContext context,   SerObjectInfoInit serObjectInfoInit,IFormatterConverter转换器,   ObjectWriter objectWriter,SerializationBinder binder)at   System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.Serialize(对象   obj,ISurrogateSelector surrogateSelector,StreamingContext context,   SerObjectInfoInit serObjectInfoInit,IFormatterConverter转换器,   ObjectWriter objectWriter,SerializationBinder binder)at   System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(对象   graph,Header [] inHeaders,_ BinaryWriter serWriter,Boolean fCheck)
  在   System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(流   serializationStream,Object graph,Header [] headers,Boolean fCheck)
  在   System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(流   serializationStream,Object graph)at   System.Resources.ResourceWriter.WriteValue(ResourceTypeCode typeCode,   对象值,BinaryWriter编写器,IFormatter objFormatter)at   System.Resources.ResourceWriter.Generate()at   System.Resources.ResourceWriter.Dispose(布尔处理)at   System.Resources.ResourceWriter.Close()at   Microsoft.Build.Tasks.ProcessResourceFiles.WriteResources(ReaderInfo   读者,IResourceWriter作家)   Microsoft.Build.Tasks.ProcessResourceFiles.WriteResources(ReaderInfo   reader,String filename)at   Microsoft.Build.Tasks.ProcessResourceFiles.ProcessFile(String inFile,   String outFileOrDir)at   Microsoft.Build.Tasks.ProcessResourceFiles.Run(TaskLoggingHelper log,   ITaskItem [] assemblyFilesList,List 1 inputs, List 1输出,布尔值   sourcePath,String language,String namespacename,String   resourcesNamespace,String filename,String classname,Boolean   publicClass,Boolean extractionResWFiles,String resWOutputDirectory)   在Microsoft.Build.Tasks.ProcessResourceFiles.Run(TaskLoggingHelper   log,ITaskItem [] assemblyFilesList,List 1 inputs, List 1个输出,   Boolean sourcePath,String language,String namespacename,String   resourcesNamespace,String filename,String classname,Boolean   publicClass,Boolean extractionResWFiles,String resWOutputDirectory)   在Microsoft.Build.Tasks.GenerateResource.Execute()at   Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()   在   Microsoft.Build.BackEnd.TaskBuilder.d
_20.MoveNext()WindowsApplication1

我也尝试过使用Visual Studio 2012,然后我在Form的背景图像中添加了一个图像,但它给了我与进入调试模式时相同的错误。我现在无法使用我的Visual Basic的两个版本处理图像。

0 个答案:

没有答案