[
    {
        "role": "user",
        "content": "can%20we%20use%20dotnet%20create%20command%20to%20create%20a%20winui%203%20app%20or%20only%20console%2C%20winforms%2C%20wpf%3F"
    },
    {
        "role": "assistant",
        "content": "Yes \u2014 you *can* use the `.NET CLI` (`dotnet new`) to create **WinUI 3** apps, but not out of the box. It requires installing additional templates or using the Windows App SDK, plus potentially community templates. Here's a breakdown:\n\n---\n\n## What `dotnet new` supports by default\n\nWhen you install the .NET SDK, certain project types come built in, such as:\n\n- console app  \n- class library  \n- unit test project  \n- ASP.NET Core apps  \n- WinForms and WPF desktop apps ([learn.microsoft.com](https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-new-sdk-templates?utm_source=openai))\n\n**WinUI 3 is not in the default templates** provided by the .NET SDK. You won\u2019t get something like `dotnet new winui` until additional templates are installed.\n\n---\n\n## How to get WinUI 3 templates\n\nThere are two main ways:\n\n### 1. Community / 3rd-party templates\n\n- The repository **egvijayanand/winui-templates** provides several WinUI 3 templates (WinUI project, Blazor + WinUI hybrid, class libraries, etc.) that you can install via `dotnet new install VijayAnand.WinUITemplates` ([github.com](https://github.com/egvijayanand/winui-templates?utm_source=openai))  \n  After installing, you can run commands such as:\n\n  ```\n  dotnet new winui -n MyApp\n  dotnet new winui-blazor -n MyHybridApp\n  ```\n\n  and specify framework versions with `-f` (e.g. `-f net8.0` or `net9.0`) ([github.com](https://github.com/egvijayanand/winui-templates?utm_source=openai))\n\n- The **Uno Platform** also includes templates using WinUI 3 for multi-platform apps (desktop, web, mobile). For example:\n\n  ```\n  dotnet new unoapp -preset=blank -o MyUnoApp\n  ```\n  This sets up a project using **WinUI 3 APIs** for the desktop piece. ([platform.uno](https://platform.uno/docs/articles/get-started-dotnet-new.html?utm_source=openai))\n\n### 2. Windows App SDK & official Microsoft support\n\n- Microsoft\u2019s **Windows App SDK** includes WinUI 3. To build a WinUI 3 app, you typically need to reference the Windows App SDK and target a Windows-based target framework (e.g. `netX-windows10.0.XXXX`). ([learn.microsoft.com](https://learn.microsoft.com/en-us/windows/apps/dev-tools/winapp-cli/guides/dotnet?utm_source=openai))  \n- However, Microsoft hasn't provided a built-in `dotnet new winui3` template *yet* in the default SDK. So you\u2019ll need either the community template or set up the project manually if you're not using those templates.\n\n---\n\n## Summary\n\nSo, to your question:\n\n> *\u201cCan we use `dotnet create` (I assume you meant `dotnet new`) to create WinUI 3 apps, or only console / WinForms / WPF?\u201d*\n\n- Without extra templates: you can only create what\u2019s included\u200a\u2014\u200aconsole, WPF, WinForms, etc.\n- With community templates or Uno\u2019s templates: **yes**, you *can* create WinUI 3 app projects via `dotnet new`.\n- With Windows App SDK: you can also manually set up a WinUI 3 project, or use templates once installed from Microsoft or 3rd parties.\n\n---\n\nIf you want, I can show specific commands to create a WinUI 3 app using your current .NET SDK version, or help add the template to your machine."
    }
]