เกิดข้อผิดพลาด CS0246 เมื่อพยายามใช้ Gtk#

ฉันกำลังพยายามสร้างโครงการโดยใช้ Gtk#

ฉันเคยใช้ Gtk# มาก่อน และใช้ SharpDevelop ในการดำเนินการนี้มาโดยตลอด

ตอนนี้ ... ดูเหมือนว่าจะไม่ทำงานอีกต่อไป:

  • ฉันได้ติดตั้งรุ่นล่าสุด Gtk# 2.12.26 สำหรับ .NET พร้อมด้วยแพ็คเกจตัวติดตั้งจาก เว็บไซต์ Mono อย่างที่ฉันเคยทำกับเวอร์ชันก่อนหน้านี้
  • ฉันได้สร้างโครงการแอปพลิเคชันบรรทัดคำสั่ง C# ใน SharpDevelop โดยใช้ C# 3.0 และกำหนดเป้าหมาย .NET 3.5
  • ฉันได้เพิ่มการอ้างอิง GAC จากโครงการของฉันเป็น atk-sharp, gdk-sharp, glib-sharp, gtk-sharp, Mono.Cairo และ pango-sharp
  • ฉันได้เพิ่ม using Gtk; ลงในไฟล์ C# หลักของฉันแล้ว
  • เมื่อฉันเขียน Gtk. IntelliSense ของ SharpDevelop จะแสดงประเภททั้งหมดที่พบในเนมสเปซ Gtk
  • เมื่อฉันคอมไพล์โปรเจ็กต์ คอมไพลเลอร์จะยกเลิกพร้อมกับข้อความต่อไปนี้:

ไม่พบประเภทหรือชื่อเนมสเปซ 'Gtk' (คุณขาดคำสั่งการใช้หรือการอ้างอิงแอสเซมบลีหรือไม่) (CS0246)

ฉันพลาดอะไรไป

สิ่งนี้จะเกิดขึ้นเมื่อฉันกำหนดเป้าหมายเป็น .NET 3.5 เท่านั้น เมื่อฉันกำหนดเป้าหมาย .NET 4.0 ฉันพบ ปัญหาที่แตกต่าง

ผลลัพธ์ที่สมบูรณ์ของคอมไพเลอร์ (ไม่ระบุชื่อเล็กน้อย) อ่านได้ดังนี้:

Build started.
Warning MSB3245: Could not resolve this reference. Could not locate the assembly "Mono.Cairo". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
Warning MSB3245: Could not resolve this reference. Could not locate the assembly "pango-sharp". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
Warning MSB3245: Could not resolve this reference. Could not locate the assembly "gtk-sharp". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
Warning MSB3245: Could not resolve this reference. Could not locate the assembly "gdk-sharp". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
Warning MSB3245: Could not resolve this reference. Could not locate the assembly "glib-sharp". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
Warning MSB3245: Could not resolve this reference. Could not locate the assembly "atk-sharp". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
Compiling ...
...\Program.cs(3,7) : Error CS0246: The type or namespace name 'Gtk' could not be found (are you missing a using directive or an assembly reference?)
Build failed. (00:00:00.1930110)

person O. R. Mapper    schedule 16.08.2015    source แหล่งที่มา
comment
ฉันคิดว่าปัญหาคือคุณต้องกำหนดเป้าหมาย. NET 4.5   -  person Baltasarq    schedule 19.08.2015
comment
@Baltasarq: คุณมีข้อมูลอ้างอิงหรือไม่? ดูเหมือนว่าเว็บไซต์ Gtk# ดูเหมือนจะไม่ได้กล่าวถึงเวอร์ชัน .NET ใดโดยเฉพาะ (?)   -  person O. R. Mapper    schedule 19.08.2015
comment
แต่น่าเสียดายที่ไม่ได้. ฉันมีเพียงคำพูดต่อไปนี้: โปรดอัปเกรดโปรเจ็กต์ของคุณเป็น Mono 4.5 (‹TargetFrameworkVersion›v4.5‹/TargetFrameworkVersion› ในไฟล์ csproj) Mono 4 ไม่รองรับอะไรที่เล็กกว่า .net 4.5 จากข้อความในรายการโมโน: lists.ximian.com/mailman/listinfo/mono -รายการ   -  person Baltasarq    schedule 20.08.2015
comment
@Baltasarq: อืม ด้วยเหตุผลบางอย่าง ตอนนี้ฉันทำให้มันทำงานบนคอมพิวเตอร์เครื่องอื่นที่ใช้ .NET 4.0 ได้ ดังนั้น ดูเหมือนว่าข้อกำหนด .NET 4.5 จะไม่ถูกต้อง หรืออาจใช้ได้กับเวอร์ชัน Bleeding Edge บางเวอร์ชันเท่านั้น แทนที่จะเป็นเวอร์ชันเสถียรสาธารณะในปัจจุบัน   -  person O. R. Mapper    schedule 20.08.2015
comment
ไม่รู้จริงๆ. ไม่สามารถช่วยคุณต่อไปได้   -  person Baltasarq    schedule 21.08.2015
comment
จะมีใครสนใจที่จะเปิดเผยสาเหตุของการลงคะแนนเสียงเพื่อที่ฉันจะได้ปรับปรุงคำถามได้หรือไม่   -  person O. R. Mapper    schedule 09.05.2017