尝试编译我的 C# 项目时,出现以下错误:
'C:\Documents and Settings\Dan\Desktop\Rowdy Pixel\Apps\CleanerMenu\CleanerMenu\obj\Debug\CSC97.tmp' is not a valid Win32 resource file.
经过多次谷歌搜索,我确定这通常是由项目使用的图标内的 256x256 图像引起的。我浏览了所有图标并删除了 256x256 版本,但错误仍然存在。关于如何摆脱这个的任何想法?
@Mike:一天晚上它神秘地出现了。我已经搜索了 csproj 文件,但没有提到 CSC97.tmp(我也检查了解决方案文件,但我也没有运气)。如果有帮助,我已在 pastebin 上发布了 csproj 文件的内容。
@Derek:没问题。这是编译器输出。
------ Build started: Project: Infralution.Licensing, Configuration: Debug Any CPU ------
Infralution.Licensing -> C:\Documents and Settings\Dan\Desktop\Rowdy Pixel\Apps\CleanerMenu\Infralution.Licensing\bin\Debug\Infralution.Licensing.dll
------ Build started: Project: CleanerMenu, Configuration: Debug Any CPU ------
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Csc.exe /noconfig /nowarn:1701,1702 /errorreport:prompt /warn:4 /define:DEBUG;TRACE /main:CleanerMenu.Program /reference:"C:\Documents and Settings\Dan\Desktop\Rowdy Pixel\Apps\CleanerMenu\Infralution.Licensing\bin\Debug\Infralution.Licensing.dll" /reference:..\NotificationBar.dll /reference:..\PSTaskDialog.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Windows.Forms.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll /reference:obj\Debug\Interop.IWshRuntimeLibrary.dll /debug+ /debug:full /optimize- /out:obj\Debug\CleanerMenu.exe /resource:obj\Debug\CleanerMenu.Form1.resources /resource:obj\Debug\CleanerMenu.frmAbout.resources /resource:obj\Debug\CleanerMenu.ModalProgressWindow.resources /resource:obj\Debug\CleanerMenu.Properties.Resources.resources /resource:obj\Debug\CleanerMenu.ShortcutPropertiesViewer.resources /resource:obj\Debug\CleanerMenu.LocalizedStrings.resources /resource:obj\Debug\CleanerMenu.UpdatedLicenseForm.resources /target:winexe /win32icon:CleanerMenu.ico ErrorHandler.cs Form1.cs Form1.Designer.cs frmAbout.cs frmAbout.Designer.cs Licensing.cs ModalProgressWindow.cs ModalProgressWindow.Designer.cs Program.cs Properties\AssemblyInfo.cs Properties\Resources.Designer.cs Properties\Settings.Designer.cs Scanner.cs ShortcutPropertiesViewer.cs ShortcutPropertiesViewer.Designer.cs LocalizedStrings.Designer.cs UpdatedLicenseForm.cs UpdatedLicenseForm.Designer.cs
error CS1583: 'C:\Documents and Settings\Dan\Desktop\Rowdy Pixel\Apps\CleanerMenu\CleanerMenu\obj\Debug\CSC97.tmp' is not a valid Win32 resource file
Compile complete -- 1 errors, 0 warnings
------ Skipped Build: Project: CleanerMenu Installer, Configuration: Debug ------
Project not selected to build for this solution configuration
========== Build: 1 succeeded or up-to-date, 1 failed, 1 skipped ==========
我还上传了我正在使用的图标。你可以在这里查看。
@迈克:谢谢!删除除 32x32 图像之外的所有内容后,一切正常。现在我可以回去并一一添加其他尺寸,看看哪个让我感到悲伤。:)
@Derek:自从我第一次遇到错误以来,我已经完全重新安装了 Windows(以及 SDK。)这不是重新安装的主要原因,但我希望它能修复问题。
现在,如果我能弄清楚为什么它以前适用于所有其他尺寸......