I’m starting in C#, I’m coming from Python, I use WSL Ubuntu on my Windows 10 to code in Python. I’m making my first API on C#. What’s the best OS to do it?

“Best” is subjective.

First, there’s a difference between where you work and where the server runs. You should use .NET Core, which means the API itself could be hosted on any platform. Docker containers are all the rage these days, but use whatever deployment strategy you want when you get there.

This decision mostly impacts the tools you get to use to make the API.
Visual Studio for Windows is arguably the best C# IDE and it only works on Windows. If you pick Mac, there is a Visual Studio for Mac that is good, but still years behind VS for Windows. On Linux, your only choice is going to be VS Code, which a lot of people love but I find inadequate for large-scale work. There is also JetBrains Rider, which is cross-platform. It is better than VS for Mac and in the same league as VS for Windows (opinions vary on if it’s better or worse, but nobody believes it’s terrible.)

I work on a Mac because I write Xamarin Forms applications. If I were working on a web API, I’d either work on a platform that closely resembles where my server would be deployed or get real cozy with Docker along the way.

Linux with dotnet core.
I just want to say that I love that this is finally a valid C# question.
To answer your question, any platform on dotnet core. If you’re going to deploy it on a server you own, it’ll make more financial sense to develop and test on Linux unless you have a Windows Server license lying around.
C# devs
null reference exceptions

source