doc/articles/create-an-app-vscode.md
[!NOTE] Make sure to setup your environment first by following our instructions.
There are two ways to create your app. You can either use the Live Wizard or the /mcp.uno.new Copilot Agent prompt.
Creating an Uno Platform project is done using dotnet new and the Uno Platform Live Wizard by following these steps:
Open a browser and navigate to the online <a target="_blank" href="https://aka.platform.uno/app-wizard">Live Wizard</a>
Configure your new project by providing a project name, then click Start
Choose a template to build your application
[!TIP] For a detailed overview of the Uno Platform project wizard and all its options, see the Wizard guide. [!NOTE] Starting with Uno.Sdk 6.0, Skia rendering is now the default rendering engine in Uno Platform templates for iOS/Android/WebAssembly. If you prefer native rendering instead, you can switch this setting in the
Featurestab underRenderer.
Click the Create button on the top right corner, then click the Copy button
In your terminal, navigate to the folder that will contain your new app.
Create a new project by pasting and executing the command that was previously generated in the Live Wizard.
[!IMPORTANT] Apple targets are automatically disabled under Linux.
Next, open the project using Visual Studio Code.
Let's assume your project is named MyApp and is located inside a Projects folder:
Using the Terminal
Ensure you are at the parent folder (Projects) level, then run:
code ./MyApp
Using Visual Studio Code
Projects folder and select the MyApp folder.Visual Studio Code might ask to restore the NuGet packages. Allow it to restore them if asked.
Once the solution has been loaded, in the status bar at the bottom left of VS Code, MyApp.sln is selected by default. Select MyApp.csproj to load the project instead.
[!IMPORTANT] A notification should appear prompting you to sign in or register with Uno Platform.
Signing in with your Uno Platform account in Visual Studio Code unlocks powerful tools like Hot Reload, helping you speed up development.
With a single registration, you also gain early access to new features and the opportunity to connect with the Uno Platform community, where you can share feedback and network.
Detailed information on registration and sign-in is available <a href="https://aka.platform.uno/account-access" target="_blank">here</a>.
/mcp.uno.new agent promptOpen VS Code in an empty new folder
Add the Uno Platform MCP by creating a file named .vscode/mcp.json:
{
"servers": {
"uno": {
"url": "https://mcp.platform.uno/v1"
}
}
}
Save the file, then on top of the registration for the uno MCP, click the start button.
Open Copilot using the center title bar icon:
Select "Agent" on the bottom-left side:
In the Copilot Window, type the /mcp.uno.new then Enter.
The Agent will ask you for your app's description, write the following:
I need a desktop app that shows the current date in the middle of the window.
Copilot will proceed for a few minutes until it asks to reload the VS Code window.
Once it does, in the command palette, select Reload Window in order the Uno Platform extension to load
[!IMPORTANT] This step is required for the uno extension to be loaded properly.
Select a csproj in the VS Code status bar, if there's a red rectangle
Wait a few seconds for the XAML Hot Reload server to become available
We can now explore the MCP:
If you want to use our MCP tools, make sure to be logged in using your account in Uno Studio by using the command palette:
When clicking on the "double wrench" icon on the right side of Copilot, you should be seeing the Uno Platform MCP tools listed:
Uno Platform provides integrated support for debugging your app on Windows, macOS, and Linux.
[!NOTE] VS Code's built-in JavaScript debugger currently only supports:
- Google Chrome
- Microsoft Edge (Chromium-based)
To debug WebAssembly with VS Code, one of these browsers must be installed.
Safari, Firefox, and other browsers are not directly supported via VS Code at the moment.
In VS Code :
Uno Platform WebAssembly Debug (Chrome) or Uno Platform WebAssembly Debug (Edge)In the status bar :
MyApp project is selected - by default MyApp.sln is selectednet10.0-browserwasm | DebugFinally, press F5 to start the debugging session.
In VS Code :
Uno Platform Mobile or Uno Platform Desktop (Debug)In the status bar :
MyApp project is selected - by default MyApp.sln is selectednet10.0-desktop | DebugFinally, press F5 to start the debugging session.
VS Code supports debugging Uno Platform Desktop apps through the WSL Extension:
When connecting to a remote Linux machine using the SSH Extension, in order for the user interface to show, it is required to specify the DISPLAY environment variable:
In the .vscode/launch.json, find the Uno Platform Desktop (Debug) section
In the env section, add the following:
"env": {
"DISPLAY": ":0"
},
This will allow the application to build on the remote machine and then show on the main display.
Note that C# Hot Reload is not available when running with the debugger. See this section for more information on Hot Reload.
In VS Code :
Uno Platform MobileIn the status bar :
MyApp project is selected - by default MyApp.sln is selectednet10.0-android | DebugFinally, press F5 to start the debugging session.
[!NOTE] Debugging for iOS is only possible when running locally (or remotely through Remote SSH) on a macOS machine.
In VS Code :
Uno Platform MobileIn the status bar :
MyApp project is selected - by default MyApp.sln is selectednet10.0-ios | DebugFinally, press F5 to start the debugging session.
[!TIP] When deploying to an iOS device, you may encounter the following error:
errSecInternalComponent. In such a case, you'll need to unlock your keychain from a terminal inside VS Code by running the following command:security unlock-keychain
[!NOTE] Debugging for Windows is only possible when running locally (or remotely through Remote SSH) on a Windows computer.
In VS Code :
Uno Platform MobileIn the status bar :
MyApp project is selected - by default MyApp.sln is selectednet10.0-windows10.0.xxxxx | DebugThis Computer device will be pre-selected. On ARM64-based computers, you will have the option to use This Computer using emulation to debug x64 applicationsFinally press F5 to start the debugging session.
You're all set!
You can also find additional VS Code topics, such as using snippets, updating existing apps to use VS Code.
Now that you've created and debugged your app, you can continue development or you can use Copilot to accelerate your workflow.
You can also learn more about: