using System;
using System.Collections.Generic;
namespace ConsoleApplication74
{
class Program<T>
{
public void Add(T X)
{
Console.WriteLine("{0}", X);
}
static void Main(string[] args)
{
Program<string> MyGeneric = new Program<string>();
MyGeneric.Add("ABC");
Console.Read();
}
}
我有erroe Program does not contain a static 'Main' method suitable for an entry point
。 Program.cs屬性的Build Action爲Compile。 我不知道什麼是錯的。通用列表和靜態主要
的可能的複製[爲什麼我不能在C#應用程序的通用型入口點使用?(HTTP://計算器.com/questions/28045923/why-i-can-use-as-entry-point-in-c-sharp-app-a-generic-type) – hatchet