views:

86

answers:

3

how can i see source code of built in controls in visual studio offline?

+2  A: 

http://referencesource.microsoft.com/netframework.aspx

Note that this is shared-source, not open-source. (You can't contribute code)

SLaks
+3  A: 

You can disassemble the IL into somewhat readable source code using Lutz Roeder's Reflector. The local variable names won't be very descriptive, but you can get a good feel for what the program logic is.

You can also disassemble IL using the ILDASM utility, but this is a bit more involved.

dthorpe
+1  A: 

In addition to what Schabse Laks writes on downloading the sources at http://referencesource.microsoft.com/netframework.aspx:

There is more info on the sourcecode at http://referencesource.microsoft.com/

You can also configure the .NET debuggers to use http://referencesource.microsoft.com/symbols as a symbol server and step through the .NET 4.0 source code:

Note that downloading the sources in your debugger can be really slow the first time (lots of sources need to be downloaded, the server might be a bit busy, or your internet connection might be slow).

--jeroen

Jeroen Pluimers