我目前正在從事一項服務,但未能構建解決方案。我的主要功能驗證碼:構建失敗,因爲有一個主要功能
[STAThread]
static void Main(string[] args)
{
ServiceBase.Run(new Service1());
}
當我評論整件事生成成功,我也評論STAThread和serviceBase ......獨自一人,還是失敗了,所以這個問題是靜態無效的主要。我需要它來運行我的服務,所以我不能離開它。
輸出類型是在Windows應用程序,現在,當我改變,要類庫構建成功,但創建.dll文件和我的應用程序必須是.exe文件
爲什麼失敗?
-Edit1- 這是構建輸出:
1>------ Build started: Project: Myst Service, Configuration: Debug Any CPU ------
1>C:\Users\Username\Documents\Visual Studio 2015\Projects\Myst Service\Myst Service\Service1.cs(23,21,23,25): error CS0017: Program has more than one entry point defined. Compile with /main to specify the type that contains the entry point.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
所以我搜索了主要的整個解決方案,它在那裏出現在Program.cs的靜態無效的主要也就是平常?
當構建失敗時,您會收到錯誤消息,您需要將錯誤消息作爲編輯添加到您的問題中。 –
@ScottChamberlain我在哪裏可以找到錯誤信息?我沒有彈出,在左下角*它說構建失敗,這就是我知道它失敗的原因...... – DFSFOT
轉到菜單欄中的'查看',你會看到一個窗口的'錯誤列表'選項你可以打開。 http://i.stack.imgur.com/yL2qc.png –