# C# source code compilation from command line (any cases, without Visual Studio)

**URL:** https://discourse.cmake.org/t/c-source-code-compilation-from-command-line-any-cases-without-visual-studio/2948
**Category:** Development
**Tags:** os:windows, lang:csharp
**Created:** [March 12, 2021, 1:48pm UTC](https://discourse.cmake.org/t/c-source-code-compilation-from-command-line-any-cases-without-visual-studio/2948 "2021-03-12T13:48:45Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Bogdan029](https://discourse.cmake.org/user_avatar/discourse.cmake.org/bogdan029/32/1260_2.png) [@Bogdan029](https://discourse.cmake.org/u/Bogdan029)
#### Post date: [March 12, 2021, 1:48pm UTC](https://discourse.cmake.org/t/c-source-code-compilation-from-command-line-any-cases-without-visual-studio/2948/1 "2021-03-12T13:48:45Z")

</div>

Dear Community. I have faced on the case when is needed to compile C# source code without **Visual Studio** usage in order to build it in DLL library and then include this package into other platforms (not only Windows-based). After a little bit of investigation **CMake** as a build tool has been chosen and appropriate configuration file ( **CMakeLists.txt** ) created. During it’s running using native command prompt there is a mistake of compilation - " **C# is currently only supported for Microsoft Visual Studio 2010 and later**". That’s why I would like to ask you share your knowledge and provide any additional cases to build it (some additional tools or whole scenarios) such as I’m a brand new in this topic and can’t proceed before that wall (; . Thank you in advance.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [March 12, 2021, 4:31pm UTC](https://discourse.cmake.org/t/c-source-code-compilation-from-command-line-any-cases-without-visual-studio/2948/2 "2021-03-12T16:31:44Z")

</div>

CMake doesn’t support C# other than through Visual Studio at this time. Development work would be required to use the compiler in non-VS environments.

---

<div class="post-metadata">

### Author: ![Bogdan029](https://discourse.cmake.org/user_avatar/discourse.cmake.org/bogdan029/32/1260_2.png) [@Bogdan029](https://discourse.cmake.org/u/Bogdan029)
#### Post date: [March 12, 2021, 4:37pm UTC](https://discourse.cmake.org/t/c-source-code-compilation-from-command-line-any-cases-without-visual-studio/2948/3 "2021-03-12T16:37:33Z")

</div>

Thanks
