首先要說我已經閱讀了類似的問題,並且我嘗試了所有的東西。在這個階段全面虧損。該錯誤消息如下:控制檯應用程序持久性錯誤不包含適用於入口點的靜態主要方法
錯誤1個計劃 'C:\用戶\ EPM \桌面\ C#的工作\項目\ ConsoleApplication10 \ ConsoleApplication10 \ OBJ \ 86 \調試\ ConsoleApplication10.exe' 不包含靜態適合的切入點
「主」方法然後又通知彈出後,我嘗試,儘管它說生成錯誤運行它
的Visual Studio無法啓動調試,因爲調試目標「C :\用戶\ EPM \桌面\ C#的工作\項目\ ConsoleApplication10 \ ConsoleApplica tion10 \ bin \ Debug \ ConsoleApplication10.exe'丟失。請構建項目並重試,或者適當地設置OutputPath和AssemblyName屬性以指向目標程序集的正確位置。
我已經花了很多時間嘗試我可以在互聯網上找到的每個解決方案,如果有人能幫助我,我會很感激。謝謝。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication10
{
class Program
{
static void main()
{
List<Student> list = new List<Student>();
list.Add(new Student() { Name = "Alan", Grade = 100 });
list.Add(new Student() { Name = "Jane", Grade = 100 });
list.Add(new Student() { Name = "Aidan", Grade = 90 });
list.Add(new Student() { Name = "Bill", Grade = 50 });
list.Add(new Student() { Name = "Liam", Grade = 80 });
list.Sort();
foreach (var element in list)
{
Console.WriteLine(element);
}
}
class Student : IComparable<Student>
{
public int Grade { get; set; }
public string Name { get; set; }
public int CompareTo(Student other)
{
if (this.Grade == other.Grade)
{
return this.Name.CompareTo(other.Name);
}
else return other.Grade.CompareTo(this.Grade);
}
public override string ToString()
{
return this.Grade.ToString() + "," + this.Name;
}
}
}
}
'static void Main()' - Capital M –
區分大小寫主要不少主... – kmcnamee
我的話,我是一個適當的eejit。非常感謝。我真的很感謝你看看。 – EpicurealDogMan