C# runs nowhere, not even in windoze.
I used to participate in a project which provided a library to unify the access to certain applications (structural analysis), some of which are free and some of which are commercial. The library was developed in C#. Then, we would use the library to make (structural) optimization code, which would be structural application agnostic.
One of our partners who developed an structural analysis application in C++, insisted on using VStudio 2010 because they said newer versions were not compatible. Indeed when we tried to use VStudio 2017 our library code would not run and had to make changes to the code. The same when we used VStudio 2019 (since then I left the project).
At home, I tried to run the library in Linux with mono. It would not compile. Also, many moons ago, a colleague told me that mikro$oft had made an "free" compiler in Linux. It didn't compile the library - it didn't even run an example of the documentation.
And, please, VStudio is NOT free software. You have to make a mikro$oft account to use it after some time.
Java has the problem of Oracle, a but at least it runs anywhere. I participated in a project 10 years ago, where I worked in Linux, and the other developers in windoze, and I never had any problems.