我创建了一个新的VSIX项目并添加了一个新项目 - >可扩展性 - >自定义工具窗口
然后我尝试构建,但它给出了一个错误:
1>------ Build started: Project: JSBQ, Configuration: Debug Any CPU ------
1>E:\JSBQ\packages\Microsoft.VSSDK.BuildTools.14.2.25123\tools\VSSDK\Microsoft.VsSDK.Common.targets(126,5): error MSB4018: The "VSCTCompiler" task failed unexpectedly.
1>E:\JSBQ\packages\Microsoft.VSSDK.BuildTools.14.2.25123\tools\VSSDK\Microsoft.VsSDK.Common.targets(126,5): error MSB4018: System.OutOfMemoryException: Out of memory.
1>E:\JSBQ\packages\Microsoft.VSSDK.BuildTools.14.2.25123\tools\VSSDK\Microsoft.VsSDK.Common.targets(126,5): error MSB4018:
at System.Drawing.Image.FromFile(String filename, Boolean useEmbeddedColorManagement)
1>E:\JSBQ\packages\Microsoft.VSSDK.BuildTools.14.2.25123\tools\VSSDK\Microsoft.VsSDK.Common.targets(126,5): error MSB4018:
at Microsoft.VisualStudio.CommandTable.BitmapItem.Read(TextReadVSCTCStream s, XmlElement itemNode)
1>E:\JSBQ\packages\Microsoft.VSSDK.BuildTools.14.2.25123\tools\VSSDK\Microsoft.VsSDK.Common.targets(126,5): error MSB4018:
at Microsoft.VisualStudio.CommandTable.ItemList.Read(TextReadVSCTCStream s, XmlElement listNode)
1>E:\JSBQ\packages\Microsoft.VSSDK.BuildTools.14.2.25123\tools\VSSDK\Microsoft.VsSDK.Common.targets(126,5): error MSB4018: at Microsoft.VisualStudio.CommandTable.CommandTable.ReadCMDSSection(TextReadVSCTCStream s, XmlElement listNode)
1>E:\JSBQ\packages\Microsoft.VSSDK.BuildTools.14.2.25123\tools\VSSDK\Microsoft.VsSDK.Common.targets(126,5): error MSB4018:
at Microsoft.VisualStudio.CommandTable.CommandTable.Read(TextReadVSCTCStream s)
1>E:\JSBQ\packages\Microsoft.VSSDK.BuildTools.14.2.25123\tools\VSSDK\Microsoft.VsSDK.Common.targets(126,5): error MSB4018:
at Microsoft.VisualStudio.CommandTable.CommandTable.Read(String fileName, ReadOptions ro, IMessageProcessor errorProcessor)
1>E:\JSBQ\packages\Microsoft.VSSDK.BuildTools.14.2.25123\tools\VSSDK\Microsoft.VsSDK.Common.targets(126,5): error MSB4018:
at Microsoft.VisualStudio.CommandTable.CommandTable.Read(String fileName, IMessageProcessor errorProcessor)
1>E:\JSBQ\packages\Microsoft.VSSDK.BuildTools.14.2.25123\tools\VSSDK\Microsoft.VsSDK.Common.targets(126,5): error MSB4018:
at Microsoft.VisualStudio.CommandTable.Compiler.Compile()
1>E:\JSBQ\packages\Microsoft.VSSDK.BuildTools.14.2.25123\tools\VSSDK\Microsoft.VsSDK.Common.targets(126,5): error MSB4018:
at Microsoft.VisualStudio.CommandTable.VSCTCompiler.Execute()
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
和
Severity Code Description Project File Line Column 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() JSBQ
我没有编辑任何代码,为什么我会收到此错误?
系统:Windows 10
编辑:Visual Studio 2015
.NET:4.5
答案 0 :(得分:3)
我也遇到了这个问题。它在添加新工具窗口后发生。
从异常堆栈中,我发现错误是由读取图像引起的。所以,我去检查随工具窗口创建的图像。最后,我发现xxxx.png是一个错误的文件,无法打开。
在package.vsct中删除了xxxx.png并注释了xxxx.png的位图节点后,VSIX项目构建成功。