2008-08-10 27 views
8

Khi cố gắng để lập dự án C# của tôi, tôi nhận được lỗi sau:Resource không hợp lệ tập tin

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

Sau khi trải qua nhiều tìm kiếm của Google, tôi đã xác định rằng điều này thường được gây ra bởi một hình ảnh 256x256 bên trong một biểu tượng sử dụng bởi dự án. Tôi đã đi qua tất cả các biểu tượng và loại bỏ các phiên bản 256x256, nhưng lỗi vẫn tồn tại. Bất kỳ ý tưởng về làm thế nào để thoát khỏi điều này?


@Mike: Nó xuất hiện một cách bí ẩn một đêm. Tôi đã tìm kiếm các tập tin csproj, nhưng không có đề cập đến một CSC97.tmp (Tôi cũng đã kiểm tra các tập tin giải pháp, nhưng tôi đã không có may mắn có một trong hai). Trong trường hợp nó giúp, tôi đã đăng contents of the csproj file on pastebin.

@Derek: Không sao cả. Đây là đầu ra của trình biên dịch.

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

Tôi cũng đã tải lên biểu tượng tôi đang sử dụng. Bạn có thể view it here.


@Mike: Cảm ơn! Sau khi xóa mọi thứ trừ hình ảnh 32x32, mọi thứ đều hoạt động tốt. Bây giờ tôi có thể quay lại và thêm các kích thước khác từng người một để xem cái nào làm tôi đau buồn. :)

@Derek: Vì lần đầu tiên tôi gặp lỗi, tôi đã thực hiện cài đặt lại hoàn toàn Windows (và cùng với nó, SDK.) Đó không phải là lý do chính cho việc cài đặt lại, nhưng tôi đã có mỏng hy vọng rằng nó sẽ sửa chữa vấn đề.

Bây giờ chỉ khi tôi có thể tìm ra lý do tại sao nó đã từng làm việc với tất cả các kích thước khác ...

+6

Vui lòng thêm câu trả lời của bạn hoặc cảm ơn trong các nhận xét không được đề cập đến. –

Trả lời

5

Tôi không biết nếu điều này sẽ giúp đỡ, nhưng từ this forum:

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.

Thử mở biểu tượng trong một biên tập biểu tượng và xem nếu bạn thấy các định dạng khác như mô tả (còn, hãy thử tháo và xem liệu dự án có xây dựng lại hay không, chỉ để xác minh biểu tượng đang gây ra nó).

0

Đây có phải là một tập tin mà bạn đã tạo và thêm vào dự án hoặc đã làm nó một cách bí ẩn xuất hiện?

Bạn có thể kiểm tra tệp .csproj của mình và xem cách nó đang được tham chiếu (nó phải là một tệp xml đơn giản và bạn có thể tìm kiếm CSC97.tmp).

lẽ gửi thông tin mà bạn tìm thấy vì vậy chúng tôi có thể có nhiều chi tiết để giúp giải quyết vấn đề của bạn

0

Nhìn xung quanh, có vẻ như một số người giải quyết điều này bằng cách sửa chữa hoặc cài đặt lại SDK .NET. Bạn có thể muốn thử.

P.S. Tôi thấy lý do tại sao bạn không bao gồm nhiều đầu ra của trình biên dịch, bây giờ. Không nhiều để thực sự thấy ở đó. :)

7

Tôi gặp sự cố tương tự với tệp "obj/debug/* .tmp" bị lỗi trong nhật ký dựng của tôi. Hóa ra ổ C: \ của tôi đã hết dung lượng. Sau khi xóa một số không gian, các bản dựng của tôi bắt đầu hoạt động.

Các vấn đề liên quan