Using Codespaces
Developing an Uno App using Codespaces
The easiest way to get started is to visit the Uno.QuickStart repository. It allows you to get started with minimal configuration or project creation steps.
To create a new Codespace, visit GitHub Codespaces.
Developing for WebAssembly
- Install the suggested Uno Platform extension
- Open the command palette (Ctrl+Shift+P) and execute the
Run uno-check
command to install the appropriate .NET SDK - Open the command palette (Ctrl+Shift+P) and run the
Install the dotnet new templates
command to install the dotnet new templates - Once the C# environment is setup, with the command palette use the command "Omnisharp: Select project" (or click on the project name in the status bar)
- Select the
MyApp
project - Using a terminal, navigate to the
MyApp
folder - Type
dotnet run -f net8.0-browserwasm
- Once the compilation is done, a server will open on port 5000
- In the Ports tab (next to the Terminal tab), right click to make both the port 5000 and the other dotnet opened port (with
uno.winui.devserver
oruno.ui.remotecontrol
in the running process column) to "public".Failure to make both ports public will prevent the app from starting properly.
- Codespaces will suggest to open a new browser window or as a preview window
You can now use C# Hot Reload and XAML Hot Reload to develop your application.
See the VS Code Getting started documentation for additional details about developing with VS Code.
Creating your Codespace from scratch
If you want to start from an empty repository, follow these steps:
Create an empty repository
Install the
unoplatform.vscode extension
from the Extensions activityOpen the command palette (Ctrl+Shift+P) and execute the
Run uno-check
command to install the appropriate .NET SDKOpen the command palette (Ctrl+Shift+P) and run the
Install the dotnet new templates
command to install the dotnet new templatesOpen a terminal and create a new project using the following command:
dotnet new unoapp -o MyApp -ios=false -android=false -macos=false -skia-tizen=false -skia-wpf=false -skia-linux-fb=false --vscode
Using the Codespaces top left menu, open the
MyApp
folder
You're ready to develop for WebAssembly.