# How to execute a programme in VSCode+OCaml Platform

**URL:** https://discuss.ocaml.org/t/how-to-execute-a-programme-in-vscode-ocaml-platform/9147
**Category:** Learning
**Created:** [January 14, 2022, 4:02pm UTC](https://discuss.ocaml.org/t/how-to-execute-a-programme-in-vscode-ocaml-platform/9147 "2022-01-14T16:02:05Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Frederic\_Loyer](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/frederic_loyer/32/3472_2.png) [@Frederic\_Loyer](https://discuss.ocaml.org/u/Frederic_Loyer)
#### Post date: [January 14, 2022, 4:02pm UTC](https://discuss.ocaml.org/t/how-to-execute-a-programme-in-vscode-ocaml-platform/9147/1 "2022-01-14T16:02:05Z")

</div>

I try to use VSCode with OCaml Platform, but when trying to execute it (Execute, Execute without debugging), VSCode ask me to select one of the “environment” : Chrome, Edge, Node.js, EarlybirdOCaml, Python.

The only OCaml related environment is EarlybirdOCaml, but it displays the error Unsupported file format.

The only way is to open a terminal, and type commands needed to run my simple program (or compile a whole project if I have something more complicated).

---

<div class="post-metadata">

### Author: ![Ulugbek](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/ulugbek/32/1864_2.png) [@Ulugbek](https://discuss.ocaml.org/u/Ulugbek)
#### Post date: [January 14, 2022, 4:45pm UTC](https://discuss.ocaml.org/t/how-to-execute-a-programme-in-vscode-ocaml-platform/9147/2 "2022-01-14T16:45:30Z")

</div>

Hi,

The OCaml Platform extension does not support building and running your programs using “Run and Debug” at this time. So there’re two alternative ways:

1. Build in terminal as you please.
2. Use a VS Code “task.” You can do so by first invoking VS Code Command Palette (cmd + shift + p on mac, and ctrl + shift + p on windows I suppose), finding and clicking on an action “Tasks: Configure Default Build Task”. The extension should suggest you a couple of possible tasks based on your dune files (dune, dune-project), you can pick one, which will create a task for you to build your (sub)-project.

Any way, I find just keeping a vscode terminal with “dune build --watch” running.

If you haven’t checked out the [Getting Started](https://github.com/ocamllabs/vscode-ocaml-platform#vscode-ocaml-platform) section of the OCaml Platform extension, you find it useful.
