Whether/when Sun released the source code isn't as relevant as the fact that JDK and JRE 1.0 in 1995 were free.
Microsoft .NET 1.0 development in 2002 required paid tools and a free version (Visual Studio Express) didn't happen until 2005. VS Express was also crippled in comparison to the paid product (VS Professional).
We can't just look at the technical features and syntax of C# and compare to Java. (E.g. they both have GC, they both have virtual machine intermediate language, etc, etc.) You also have to compare the social factors that built up around each.
MS .NET/C# was a continuation of Visual Basic 6.0, Access db, and FoxPro. Those dev tools were used for line-of-business enterprisey apps. Even Microsoft's initial offerings for web dev was ASP WebForms which tried to continue the VB WinForms desktop paradigm into a HTTP/HTML world. That was the social situation around MS dev tools and NET 1.0 continued that. It continues to this day.
Java had a different set of social dynamics -- and that also continues to this day -- even though a significant chunk of Java dev is also line-of-business CRUD enterprise apps. If anyone was a hacker or student with no money outside the domain of boring corporate CRUD apps, it was much more likely that he/she would scratch an itch with Java instead of C# (if it was down to a choice between those 2).
It is not an accident that new things like Hadoop, Elasticsearch, iText for PDF, etc got written with Java first. Even though there's no technical reason to prevent those projects from getting birthed on C# before Java, the inertia of C#'s community dynamic keeps it from happening. The past matters and it overwhelms any technical equivalence between the platforms.
In general, you're correct about the difference being social, nt one of licencing. You're wrong on one thing: Microsoft's .NET 1.0 CLR and compilers were also free from day one. You never HAD to use VS to develop with .NET, any more than you HAD to use NetBeans or Eclipse to develop with Java.
Yes, the .NET SDK had a command line compiler so theoretically, it could compile .cs files for free. However, nobody used it for serious Windows Forms GUI type of work. Realistically, corporations and hobbyists had to buy VS Studio to write non-trivial apps. On the other hand, people were writing Java GUI apps with free tools. Eclipse was free back in 2001 before .NET 1.0 was released.
The only common use case I remember for the free C# command line compiler was to type in exercises from C# tutorials.
Also, even if compiling C# source code was free, the execution stack for the NET runtime was not free. MS Windows operating system licenses and MS SQL Server cost money. In comparison, Linux and MySQL were free. The different costs for deployment affected social dynamics as well.
For .NET 1.0, there was no msbuild - csproj files were not build files, and they weren't part of .NET, but part of VS. And until James Duncan Davidson got fed up with maintaining batch files and threw together Ant to manage his Tomcat build process, there was no build solution for Java, either.
The significant word there is student. CS departments started using Java for an awful lot of teaching. I would wager that plenty of those "hard" OSS projects have a genesis in academia, and even if not that Java became a sort of lingua franca for writing code you wanted discussed or accepted in that sort of way.
Microsoft .NET 1.0 development in 2002 required paid tools and a free version (Visual Studio Express) didn't happen until 2005. VS Express was also crippled in comparison to the paid product (VS Professional).
We can't just look at the technical features and syntax of C# and compare to Java. (E.g. they both have GC, they both have virtual machine intermediate language, etc, etc.) You also have to compare the social factors that built up around each.
MS .NET/C# was a continuation of Visual Basic 6.0, Access db, and FoxPro. Those dev tools were used for line-of-business enterprisey apps. Even Microsoft's initial offerings for web dev was ASP WebForms which tried to continue the VB WinForms desktop paradigm into a HTTP/HTML world. That was the social situation around MS dev tools and NET 1.0 continued that. It continues to this day.
Java had a different set of social dynamics -- and that also continues to this day -- even though a significant chunk of Java dev is also line-of-business CRUD enterprise apps. If anyone was a hacker or student with no money outside the domain of boring corporate CRUD apps, it was much more likely that he/she would scratch an itch with Java instead of C# (if it was down to a choice between those 2).
It is not an accident that new things like Hadoop, Elasticsearch, iText for PDF, etc got written with Java first. Even though there's no technical reason to prevent those projects from getting birthed on C# before Java, the inertia of C#'s community dynamic keeps it from happening. The past matters and it overwhelms any technical equivalence between the platforms.