Creating an app with VS Code

Note

Make sure to setup your environment by following our instructions.

Create the App

Creating an Uno Platform project is done using dotnet new and the Uno Platform Live Wizard by following these steps:

  1. Open a browser and navigate to the online Live Wizard

  2. Configure your new project by providing a project name, then click Start

    A screen showing how to choose a solution name

  3. Choose a template to build your application

    A screen showing how to choose template for the new app

    Tip

    For a detailed overview of the Uno Platform project wizard and all its options, see the Wizard guide.

  4. Click the Create button on the top right corner, then click the Copy button

    A screen showing the dotnet new command to create the new app

  5. In your terminal, navigate to the folder that will contain your new app.

  6. 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:

  • In the terminal type the following:

    code ./MyApp
    
  • 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.

Debug the App

Uno Platform provides integrated support for debugging your app on Windows, macOS, and Linux.

In VS Code :

  1. In the activity bar select the debugger
  2. Set the debugger launch to Debug (Chrome, WebAssembly)

VS Code UI

In the status bar :

  1. Just after the Uno logo, ensure the MyApp project is selected - by default MyApp.sln is selected
  2. Next, click on the target framework to select net8.0-browserwasm | Debug

status bar

Finally, 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

Next Steps

Now that you're Created and Debug the App.

Learn more about: