无效的资源文件 [英] Invalid Resource File

查看:153
本文介绍了无效的资源文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当试图编译我的C#项目,我收到以下错误:

When attempting to compile my C# project, I get the following error:

'C:\Documents and Settings\Dan\Desktop\Rowdy Pixel\Apps\CleanerMenu\CleanerMenu\obj\Debug\CSC97.tmp' is not a valid Win32 resource file.



经过许多谷歌搜索已经走了,我已经确定,这通常是内部的引起的256x256的图像该项目使用的图标。我已经通过所有的图标不见了并删除了256x256的版本,但错误依然存在。 ?如何摆脱这种

Having gone through many Google searches, I have determined that this is usually caused by a 256x256 image inside an icon used by the project. I've gone through all the icons and removed the 256x256 versions, but the error persists. Any ideas on how to get rid of this?

@Mike任何想法:它出现了神秘的一个晚上。我搜索了的csproj文件,但没有一个CSC97.tmp提到(我也检查了解决方案文件,但我没有运气有其一)。万一有帮助,我已经张贴上引擎收录上的csproj文件的内容。

@Mike: It showed up mysteriously one night. I've searched the csproj file, but there's no mention of a CSC97.tmp (I also checked the solution file, but I had no luck there either). In case it helps, I've posted the contents of the csproj file on pastebin.

@Derek:没问题。以下是编译器输出

@Derek: No problem. Here's the compiler output.

------ 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 ==========

我还上传了我使用的图标。您可以查看这里。

I have also uploaded the icon I am using. You can view it here.

@Mike:谢谢!去除一切,但32×32的图像后,一切都很好。现在,我可以回去,并添加其他尺寸一个接一个,看看哪一个是造成我的悲伤。 :)

@Mike: Thanks! After removing everything but the 32x32 image, everything worked great. Now I can go back and add the other sizes one-by-one to see which one is causing me grief. :)

@Derek:自从我第一次得到了错误,我做的Windows完全重新安装(和与它一起,该SDK)事实并非如此。主要的原因重新安装,但我有一个渺茫的希望,这将解决这个问题。

@Derek: Since I first got the error, I'd done a complete reinstall of Windows (and along with it, the SDK.) It wasn't the main reason for the reinstall, but I had a slim hope that it would fix the problem.

现在,如果只有我能弄清楚,为什么它以前与所有其他工作大小...

Now if only I can figure out why it previously worked with all the other sizes...

推荐答案

我不知道这是否会帮助,但来自的this论坛

I don't know if this will help, but from this forum:

添加.ico文件到属性页的应用程序部分,并收到错误多数民众赞成被描述的,当我检查与图标编辑器的图标文件时,转出该文件有图像的多个版本,即(16×16 24× 24,32×32 48×48远景压缩),我删除,我没有想重新保存该文件(只是32倍32)和现在的应用程序编译没有错误,其他格式。

Add an .ico file to the application section of the properties page, and recieved the error thats been described, when I checked the Icon file with an icon editor, it turn out that the file had more than one version of the image ie (16 x 16, 24 x 24, 32 x 32, 48 x 48 vista compressed), I removed the other formats that I didnt want resaved the file (just with 32x 32) and the application now compiles without error.

尝试在图标编辑器中打开该图标,看看你看其他格式,如描述的(也尝试删除的图标并查看该项目将再次构建,只是为了验证该图标是造成它)。

Try opening the icon in an icon editor and see if you see other formats like described (also, try removing the icon and seeing if the project will build again, just to verify the icon is causing it).

这篇关于无效的资源文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆