> For the complete documentation index, see [llms.txt](https://learn.qanplatform.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learn.qanplatform.com/developers/qvm-multi-language-smart-contracts/docs-for-supported-languages/c-c-sharp-smart-contract/compiling-a-smart-contract-in-c-c-sharp.md).

# Compiling a smart contract in C# (C-Sharp)

### Compiling C# smart contract to static binary with the QVM compiler

We already supply a simple compiler container which will perform the most optimized build of turning above sample contract to a static binary which can be run by QVM.

Since you saved the previous sample contract as `main.cs` in your current directory, you can run the compiler like this:

```bash
docker run --rm -v $(pwd):/ws qanplatform/qvm-compiler-csharp
```

Afterwards you will end up with a statically linked linux ELF binary called “contract” in your current directory.

```shell
# checking output size of QVM compiler
ls -alh contract
-rwxr-xr-x  1 user  group    1.0M Jul 9 23:24 contract
```
