1

Sorry for my complete ignorance on this matter. I know what http://referencesource.microsoft.com/ aka http://sourceof.net is and I use it from time to time.

But I can't understand what this github repository at https://github.com/Microsoft/referencesource is for. I read its ReadMe.md file but I didn't understand anything.

Could you please explain what that repository holds and why would it be useful?

Water Cooler v2
  • 32,724
  • 54
  • 166
  • 336
  • You can't pull source from the first site, but you can from the second. I think you're overthinking this. The purpose is the obvious one. – Cody Gray - on strike Sep 08 '16 at 14:07
  • I still don't get the idea of being able to pull source from the second one, because I checked all the folders and they do not contain the code that I was expecting to be there. For instance, `System.Net` does not contain the `WebClient` class. Or may be it does but the file organization is not one-file-per-class, which is something endemic to many open source projects that come even from within Microsoft. – Water Cooler v2 Sep 08 '16 at 14:12
  • That's because whilst [it](https://msdn.microsoft.com/en-us/library/system.net.webclient(v=vs.110).aspx)'s in the `System.Net` **namespace**, it's in the `System` **assembly**. So you find it's [source in there](https://github.com/Microsoft/referencesource/blob/d925d870f3cb3f6acdb14e71522ece7054e2233b/System/net/System/Net/webclient.cs) – Damien_The_Unbeliever Sep 08 '16 at 14:26
  • @Damien_The_Unbeliever Thank you. All these comments put together answer my question. Would you like to write an answer? If not, I'll consolidate the discussion in the comments into an answer? – Water Cooler v2 Sep 08 '16 at 14:40

1 Answers1

1

As the commentators mentioned in the comments to this question, the github repository at https://github.com/Microsoft/referencesource contains a sub-set of the .NET framework source code.

You can pull or fork from this repository.

I was misled to believe that it isn't the source code of the .NET framework because before posting this question, I peeked into several folders and source code but couldn't find the classes I was expecting. It turns out, I was looking at the wrong places. For e.g. I started looking for the System.Net.WebClient class, which is in the System.dll assembly in the System.Net folder but couldn't find it. Turns out, the class is present in the folder named System.

Water Cooler v2
  • 32,724
  • 54
  • 166
  • 336
  • 1
    I hate to point this out, but if you were interested in `WebClient`, you could have used the search box at the top of the github page. It only returns 12 hits and (unless github customises search results, which I don't believe they do), the `webclient.cs` file is the second result. Don't search manually when computers can do it for you. – Damien_The_Unbeliever Sep 08 '16 at 17:04
  • @Damien_The_Unbeliever That's true. I have used search on GitHub only a few times and am more recently beginning to make a habit of using it instead of manually browsing through the directories. – Water Cooler v2 Sep 08 '16 at 19:15