They did. They called in J++ and gave it extensions, leading to a schooyard scuffle with Sun. When the school principal said Sun were right, they went off sulking and made Dot Net.
Microsoft had an underlying operating system that they wanted to rewrite substantially in C# on the .NET VM. They had a decent motivation for not having a core piece of Windows dependent on a product from another vendor that was competing in some of the same markets as their core product.
Google by contrast isn't nearly as invested in Dart as Microsoft was (and still is) in C#/.NET. Perhaps a better objection is that they should have just used Go — or a Go-binary-compatible language built on some of the same toolchain. (See also: Vala and Guile still don't play nice together as well as they should for two languages from the same project.)
Genuine question, is this comparison really apples to apples? Microsoft wanted to compete with sun right? Does google want to compete with programming languages like this? My gut tells me this is NIH not wanting to compete.
Microsoft didn't want to compete with Sun so much as have an application development language with a garbage collector that wasn't owned by Sun.
You don't make much money off programming languages inherently.
This also elides an obvious riposte (so you mean they should have just used Mono? how did all that work out?) and a metric ton of differences between what C# targets and what Dart targets.
MS wanted to fracture the Java ecosystem. The Microsoft Java VM was an attempt to lockin developers to MS Java and not sun Java. They created J# and C# because of the sun lawsuit they lost.
They still wanted a Java like ecosystem but they would be sure it only ran on Windows servers.
MS spent years being hostile to open source software. It's only in about the past decade that they've turned a corner.
Here's a famous email from Bill Gates about Java and how to stop it.
It's much much more complicated than that. Sun refused to add many language features that Microsoft (then a cautious but also genuine user of Java) wanted. Such as refusal to add delegates/closures:
J++, which was Microsoft's Java implementation in the 90's added a few language extensions that were clearly not Sun-approved, but driven by internal engineering feedback at MS. C# having struct and class keywords, allowing you to define your own value types, is clearly a result of that missing in Java, which still in 2025 has no such equivalent yet.
Also Java's then native code interop solution, JNI, was and still remains complete garbage, and it's flaws were a huge guide for Microsoft when they deveoped .NET and it's native interop equivalent, PI (platform invoke).
The key point is that C# was happening regardless of whatever technical upsides people wanted to see out of it. C# would still exist today and still be just as popular in the Windows ecosystem even if it made all the same exact mistakes as Java.