管理專案和方案屬性Managing Project and Solution Properties

專案選項Project options

專案選項專屬於每個專案,並影響如何撰寫、建置和執行專案。Project options are specific to each project and affect how the project is written, built, and run. 不同于使用者特定設定 Visual Studio for Mac 喜好設定,專案選項會儲存在專案 ( .csproj) 檔中,讓其他開發人員可以正確地建立及執行專案。Unlike Visual Studio for Mac preferences which are user-specific settings, project options are stored in the project (.csproj) file, so that other developers can build and run the project correctly. 使用特定專案選項可讓多個開發人員處理相同的文件,而不影響檔案格式。Having specific project options allows many developers to work on the same document without compromising the formatting of the file.

若要在 Visual Studio for Mac 中開啟專案選項,請按兩下專案名稱,或以滑鼠右鍵按一下以開啟操作功能表,然後選取 [選項]:To open Project options in Visual Studio for Mac, double-click the project name, or right-click to open the context menu, and then select Options :

操作功能表中的選項

可編輯的選項包含建置、執行以及設定原始程式碼和版本控制的選項。Editable options include options to build, run, and set source code and version control.

專案選項會組織成五個不同的類別:Project options are organized into five different categories:

  • 一般 - 您會在這裡設定 [名稱]、[描述] 和 [預設命名空間] 等專案資訊,以及專案的 [位置]。General - Project information such as Name, Description, and Default Namespace are set here, along with the Location of the project.
  • Build -用來設定或變更可移植類別庫的 PCL 設定檔。Build - Used to set or change PCL profiles for Portable Class Libraries. 它也允許自訂命令、組態、要設定的編譯器選項。It also allows for custom commands, configurations, compiler options to be set. 您也可以在這裡設定輸出路徑和組件名稱。The output path and assembly name can also be set here.
  • 執行 -用來針對每個專案建立自訂執行設定。Run - Used to create custom run configurations on a per-project basis.
  • 原始程式碼 -控制許多不同檔案類型和命名慣例的格式。Source Code - Controls the formatting of many different file types and naming conventions. 您也可以在這裡設定命名原則和預設標頭樣式。You can also set the naming policies and default header styles here.
  • 版本控制 -在您的專案中使用版本控制時,設定認可訊息樣式的選項。Version Control - Options to set the style of commit messages when using Version Control with your project.

每個專案都可以包含特定的專案選項 (視平台而定)。Each project can contain specific project options, depending on the platform. 例如,下圖中所述 Xamarin.Android 專案會有與 Android 組建相關的選項 (例如連結器選項),以及與應用程式相關的選項 (例如權限):For example, a Xamarin.Android project, like the one illustrated in the following image, has options relating to the Android build (such as linker options) and the Application (such as permissions):

Android 專案選項

Xamarin.iOS 具有與套件組合簽署相關的選項,例如要使用的必要佈建設定檔:Xamarin.iOS has options related to bundle signing - such as the required provisioning profile to use:

iOS 專案選項

方案選項Solution Options

方案選項就像專案選項,但涵蓋整個方案的範圍。Solution options are like Project options, but cover the scope of the entire Solutions. 它們提供方法來設定作者資訊、組建設定、程式碼格式樣式和版本控制,並且允許在方案中指派啟始專案的方法。They provide a way to set author information, build settings, code formatting styles, and version control, and they allow for a way to assign the startup project in the Solution. 您可以從 > 專案 的 [方案選項] 功能表項目、方案視窗中方案的 [ 選項 ] 內容功能表項目,或在 [方案] 視窗中按兩下方案,來存取 [方案選項] 對話方塊:The Solution Options dialog can be accessed from the Project > Solution Options menu item, from the Options context menu item on the Solution in the Solution Window, or by double-clicking on the Solution in the Solution Window:

方案選項

請參閱See also