"VSCTCompiler" 任务意外失败,出现 OutOfMemoryException

The "VSCTCompiler" task failed unexpectedly with OutOfMemoryException

我做的是:

我从可扩展性模板创建了一个新的 VSIX 项目。 我为 ToolWindow1 添加了一个新项目。

然后我编译得到消息。它是在 Visual Studio 2015 年。 电脑内存为8GB,Visual Studio安装在全新电脑上。

我收到的消息如下:

Severity    Code    Description Project File    Line    Suppression State
Error       The "VSCTCompiler" task failed unexpectedly.
System.OutOfMemoryException: Out of memory.
   at System.Drawing.Image.FromFile(String filename, Boolean useEmbeddedColorManagement)
   at Microsoft.VisualStudio.CommandTable.BitmapItem.Read(TextReadVSCTCStream s, XmlElement itemNode)
   at Microsoft.VisualStudio.CommandTable.ItemList.Read(TextReadVSCTCStream s, XmlElement listNode)
   at Microsoft.VisualStudio.CommandTable.CommandTable.ReadCMDSSection(TextReadVSCTCStream s, XmlElement listNode)
   at Microsoft.VisualStudio.CommandTable.CommandTable.Read(TextReadVSCTCStream s)
   at Microsoft.VisualStudio.CommandTable.CommandTable.Read(String fileName, ReadOptions ro, IMessageProcessor errorProcessor)
   at Microsoft.VisualStudio.CommandTable.CommandTable.Read(String fileName, IMessageProcessor errorProcessor)
   at Microsoft.VisualStudio.CommandTable.Compiler.Compile()
   at Microsoft.VisualStudio.CommandTable.VSCTCompiler.Execute()    VSIXProject1

这有什么办法吗?

Visual Studio 创建的文件似乎已损坏。您可以在文件夹“/Resources”(应该位于您的 .csproj 文件旁边)的文件资源管理器中自行检查文件,并尝试使用其他程序打开它。

要修复错误,请将文件替换为有效的 .png 文件。对我来说,它通过从可扩展性模板创建一个新的 "ItemTemplate" 项目来工作。然后添加项目 - >自定义命令。

这创建了一个有效的 .png,可用于替换 VSIX 项目中损坏的 .png 文件。

在此处找到解决方案:https://dotblogs.com.tw/rainmaker/2016/08/23/132552

如果你不会说韩语,这里是 google 翻译:https://translate.google.at/translate?hl=de&sl=zh-TW&u=https://dotblogs.com.tw/rainmaker/2016/08/23/132552&prev=search