iT邦幫忙

0

VS 2021 一個Consloe專案,有多個main,要如何設定現在用哪一個

  • 分享至 

  • xImage

您好:
如下圖,當一個專案,有兩個以上的main,要如何選擇用哪一個

https://ithelp.ithome.com.tw/upload/images/20211218/20104095cOqDqvIKE1.png

我參考
https://social.msdn.microsoft.com/Forums/zh-TW/9641c8fe-a0cf-4a5a-9133-36d58b0f3fd1/1996820491235602669620013652922281020491xxcs65292350413875437117?forum=233

但找不到
謝謝!

圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中
1
海綿寶寶
iT邦大神 1 級 ‧ 2021-12-18 22:44:15
最佳解答

找找看
Project -> Properties -> Aplication Tab -> Startup object.
專案 -> 專案屬性 --> 應用程式 --> 啓始物件

或者治本的方法
一個專案裡只寫一個 main (進入點)

noway iT邦研究生 2 級 ‧ 2021-12-19 09:54:37 檢舉

謝謝@

0
Samuel
iT邦好手 1 級 ‧ 2021-12-18 20:42:52

一個Console只能有一個Main程式進入點吧
你可以在Main主程式進入點用if或捨麼switch去設置跑哪個特定方法或包裝成特定class去執行

0
elizabeth1
iT邦見習生 ‧ 2023-04-04 18:39:09

在一個 Console 專案中,每個程式檔案中只能有一個 main 函式。如果您的專案中有多個程式檔案,每個檔案都有一個 main 函式,您需要指定要執行的程式檔案。
在 Visual Studio 2021 中,您可以使用「啟動專案」設定來指定要執行的程式檔案。以下是步驟:먹튀검증사이트
在 Visual Studio 中開啟您的 Console 專案。

【**此則訊息已被站方移除**】
12345965
iT邦見習生 ‧ 2023-06-05 18:56:59
【**此則訊息已被站方移除**】
0
9823
iT邦見習生 ‧ 2023-06-25 20:15:47

washmachineinfo are appliances designed for the purpose of washing laundry, such as clothing, towels, and bedding. They are an essential part of modern households and offer a convenient and efficient way to clean clothes.

9860217t3
iT邦見習生 ‧ 2023-07-13 16:53:49
【**此則訊息已被站方移除**】
【**此則訊息已被站方移除**】

我要發表回答

立即登入回答