在建设有19个项目一VS 2008解决方案,我有时会:Visual Studio的错误:“GenerateResource”任务意外失败
The "GenerateResource" task failed unexpectedly.
System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at System.IO.MemoryStream.set_Capacity(Int32 value)
at System.IO.MemoryStream.EnsureCapacity(Int32 value)
at System.IO.MemoryStream.WriteByte(Byte value)
at System.IO.BinaryWriter.Write(Byte value)
at System.Resources.ResourceWriter.Write7BitEncodedInt(BinaryWriter store, Int32 value)
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, ArrayList inputs, ArrayList outputs, Boolean sourcePath, String language, String namespacename, String resourcesNamespace, String filename, String classname, Boolean publicClass)
at Microsoft.Build.Tasks.GenerateResource.Execute()
at Microsoft.Build.BuildEngine.TaskEngine.ExecuteInstantiatedTask(EngineProxy engineProxy, ItemBucket bucket, TaskExecutionMode howToExecuteTask, ITask task, Boolean& taskResult) C:\Windows\Microsoft.NET\Framework\v3.5
VS后通常发生已经运行了约4小时;要正确编译VS的唯一方法是关闭VS,然后重新启动它。
我在一台3GB Ram的机器上。 TaskManager显示devenv.exe工作集为578060K,整个机器内存分配为1.78GB。它应该有足够的内存来生成资源。
我遇到了同样的问题,我的解决方案是清理构建,关闭visual studio,重新打开它并重新构建解决方案。 – smwikipedia 2011-03-22 07:53:47
[Visual Studio错误:“GenerateResource”任务意外失败...文件存在]可能重复(http://stackoverflow.com/questions/7795926/visual-studio-error-the-generateresource-task-failed-意外的是,这个fil) – 2016-09-27 11:34:50