1

I browsed through some questions and this one stood out as the better one: .Net Classes and their source code which pointed me to this place here: Microsoft Reference Source Server.

I tried everything the site says, downloaded a file that I cannot open from there and at some point ended up with a .pdb file in my source folder for the symbol cache that I could not open with a multitude of tools I looked into.

So this is my last resort to find an answer to my question. Out of pure curiosity (and lack of a better way to understand some stuff) I want to open a particular class from Microsoft (namely I wanna look into RichTextBox and maybe the classes it inherits from) but I simply cannot find a way to make this work for me. I want the original source, not a decompiler product because, well because I mainly need to understand some stuff, not see random variable names. I appreciate any help that may get me around my stupidity and clumsiness, as well as the right tools to do so (if any other than VS).

Note that I am using Visual Studio 2012 and yes, I went over a guide covering this specific version instead of the guide on VS 2008.

Community
  • 1
  • 1
Angelos Chalaris
  • 6,611
  • 8
  • 49
  • 75
  • 1
    Did you try the "Download" links on this page: http://referencesource.microsoft.com/netframework.aspx ? Also, try downloading them via Internet Explorer. My Firefox attempted to download an `.aspx` file instead of the installer itself for some reason. – Chris Sinclair Jun 06 '13 at 18:15
  • @ChrisSinclair I actually stated that I tried everything there, including the Download page. The downloaded file, though, was a .aspx file which, if you say so, I will redownload with IE. ;) – Angelos Chalaris Jun 06 '13 at 18:17
  • .NET is not `Open Source`. You could find some obfuscated code in there too. :) – Parag Meshram Jun 06 '13 at 18:18
  • @ParagMeshram I know it is not, but the site I linked to states that the source code is available there so yeah, it seems like I could check it out. Still I am not supposed to modify the code or anything I think so it is fine! :P – Angelos Chalaris Jun 06 '13 at 18:19
  • 1
    Here's some source code for it I found via google; for version 4.0 at least: http://www.dotnetframework.org/default.aspx/4@0/4@0/DEVDIV_TFS/Dev10/Releases/RTMRel/ndp/fx/src/WinForms/Managed/System/WinForms/RichTextBox@cs/1305376/RichTextBox@cs (EDIT: updated link to _slightly_ newer version) – Chris Sinclair Jun 06 '13 at 18:20
  • @ChrisSinclair both your comments are really constructive and useful to me, first one worked already (IE downloads it just fine as an executable) and the second one may be exactly what I need and skip me the trouble. Thanks a lot! ;) – Angelos Chalaris Jun 06 '13 at 18:22
  • 2
    check this out - http://stackoverflow.com/questions/12118735/downloading-net-4-source-code – Parag Meshram Jun 06 '13 at 18:23
  • 3
    rename `netframework.aspx -> netframework.msi` – Parag Meshram Jun 06 '13 at 18:24
  • @ParagMeshram also a good reply and a very good link! Thanks! – Angelos Chalaris Jun 06 '13 at 18:25

1 Answers1

4

The "download" links on this page: http://referencesource.microsoft.com/netframework.aspx should work. However try downloading them via Internet Explorer; my Firefox attempted to download an .aspx file instead of the installer itself for some reason. (EDIT: as @ParagMeshram pointed out, just rename the netframework.aspx to netframework.msi as a quick fix if necessary)

In addition, here's a link to the source hosted by dotnetframework.org: http://www.dotnetframework.org/default.aspx/4@0/4@0/untmp/DEVDIV_TFS/Dev10/Releases/RTMRel/wpf/src/Framework/System/Windows/Controls/RichTextBox@cs/1305600/RichTextBox@cs

I can't say for certain if it's the latest greatest, or what you would be compiling against exactly, but should give you a good idea of how it works.

Chris Sinclair
  • 22,858
  • 3
  • 52
  • 93