Where is the source code of .NET framework?

  • Thread starter Thread starter André
  • Start date Start date
A

André

Hi all,

I am contructing a class derived of DataGridTextBoxColumn with very much
modification.

However, I need to see the code of base class to know what should I in some
inherited methods.

Where do I find the source of the class?

Thanks a lot

André
 
Andre,

The source code for the framework was not released as part of the public
domain. You won't be able to see it unfortunately.
 
I was just thinking about this the other day. I understand why they may not
want to release all the framework. However one or two classes as a nice
example/sample would be nice and helpful. A class with abstraction,
containment and maybe one that encapsulates calling other framework classes
and how they do exception handling as a reference seems like a good thing.
One or two classes out of 1000+ would seem reasonable and they could point
people in Help and whitepapers on how they approach creating a framework,
abstraction, patterns, etc.

--
William Stacey, DNS MVP

Nicholas Paldino said:
Andre,

The source code for the framework was not released as part of the public
domain. You won't be able to see it unfortunately.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

André said:
Hi all,

I am contructing a class derived of DataGridTextBoxColumn with very much
modification.

However, I need to see the code of base class to know what should I in some
inherited methods.

Where do I find the source of the class?

Thanks a lot

André
 
I agree with Andrè, but maybe you can use the ILDASM utility shipped with
the FrameworkSdk (C:\Program Files\Microsoft Visual Studio
..NET\FrameworkSDK\bin\ildasm.exe or other). Open the assembly containing the
class (System.Windows.Forms), and look inside the IL - code. It's no c# or
vb.net code, but, even if you don't know IL, you can see if a method just
calls another method, or contains "real" implementation, or witch members
shall be override in your case.

GP
 
William Stacey said:
I was just thinking about this the other day. I understand why they may not
want to release all the framework. However one or two classes as a nice
example/sample would be nice and helpful. A class with abstraction,
containment and maybe one that encapsulates calling other framework classes
and how they do exception handling as a reference seems like a good thing.
One or two classes out of 1000+ would seem reasonable and they could point
people in Help and whitepapers on how they approach creating a framework,
abstraction, patterns, etc.

Wasn't that part of the reason for rotor, to show how they developed a large
portion of the framework?
Plus, there is no reason they need to use a framework class as an example,
I'm quite sure plenty of classes exist that show those basics at a level
most developers care about.
--
William Stacey, DNS MVP

in message news:[email protected]...
Andre,

The source code for the framework was not released as part of the public
domain. You won't be able to see it unfortunately.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

André said:
Hi all,

I am contructing a class derived of DataGridTextBoxColumn with very much
modification.

However, I need to see the code of base class to know what should I in some
inherited methods.

Where do I find the source of the class?

Thanks a lot

André
 
Lets see - Borland can supply the Delphi source code but microsoft can't or
won't. I for one
do not understand that.
grs
 
Uhhm,

Well if you recall during the Microsoft Anti-Trust case M$
lawyers argued against releasing OS source code to the
general public on the grounds that "the code is so horrid
that it could possibly threaten national security".

--Richard

P.S. I'm not joking, a lawyer did make that argument to
the court...
 
You have a point.. but with the Security Push MS is on, I doubt they'd give
anything that could be used to find/exploit vulnerabilities. Plus, if you
could have all of the source code...that would undoubtedly be used to pirate
stuff.
 
You can disassemble any of the .NET Framework Class Library assemblies to C#
or VB.NET code using a tool like Reflector (see link below).

http://www.aisto.com/roeder/dotnet/

You can also download the Shared Source Common Language Infrastructure
(commonly called Rotor) from Microsoft. Rotor is a version of the framework
that works on Windows and FreeBSD and it comes with source code, most of
which is written in C#. There are no GUI classes and there are no guarantees
that the source is the same as the .NET Framework for Windows but I'd be
willing to bet that it's almost identical for a vast majority of the
classes. Form more information on Rotor see the link below

http://www.microsoft.com/downloads/...FA-7462-47D0-8E56-8DD34C6292F0&displaylang=en
 
Plus, there is no reason they need to use a framework class as an example,
I'm quite sure plenty of classes exist that show those basics at a level
most developers care about.

There is no reason they have to and they do have other samples. However
using a real class that is in production *inside the framework carries a
more power as an example IMO. Most of the samples I have seen are only that
and are not meant to be production ready. What sounds better to you - "Here
is how you do a widget inside a widget." or "Here is how we implemented the
IPAddress class in the Framework. This shows how we used Pattern x and
notice how we contained y objects and handled excepsions." Full production
example of something you use or at least see in the Framework. Much more
powerful as an example IMO.

--wjs
 
Thanks Rob. Now that is cool tool. I assume it is legal to view the
framework disassembled classes, however would it be legal to post this code
if you had a question on some of it?

--
William Stacey

Rob Windsor said:
You can disassemble any of the .NET Framework Class Library assemblies to C#
or VB.NET code using a tool like Reflector (see link below).

http://www.aisto.com/roeder/dotnet/
....
 
What sounds better to you - "Here
is how you do a widget inside a widget." or "Here is how we implemented the
IPAddress class in the Framework. This shows how we used Pattern x and
notice how we contained y objects and handled excepsions." Full production
example of something you use or at least see in the Framework.

Maybe something like this would be too embarrassing...

Chris
 
Could also be that many of the framework classes take use internal calls and
classes that aren't available outside of the framework assemblies. What good
is an example that uses code we can't use. I think that would result in
simply confusing anyone who needs the examples in the first place and annoy
everyone else, giving them something else to whine about ad nasuem. I really
do get tired of listening to people sob over not having things they have no
real use for, get over it, do your job, and go home.
 
After all, it's all about learning...isn't it? How others (especially the
designers) implement stuff so that can (hopefully) expand your knowledge in
general and specifically about the system your using day to day. So no one
is sobing here. Besides, someone else posted useful information that I used
to look at many of the classes myself already. It helped clarify many
things for me and was suprized at a few others. BTW - there are many things
that just call into win32 api, but many do not and are quite clearly
readable. These ngs are here to help spread knowledge and understanding,
so I never understand why some people tell others to "go home" and forget
about it and others look for understanding, gain some, and gladly help
others?
 
William Stacey said:
After all, it's all about learning...isn't it? How others (especially the
designers) implement stuff so that can (hopefully) expand your knowledge in
general and specifically about the system your using day to day. So no one
is sobing here. Besides, someone else posted useful information that I used
to look at many of the classes myself already. It helped clarify many
things for me and was suprized at a few others. BTW - there are many things
that just call into win32 api, but many do not and are quite clearly
readable. These ngs are here to help spread knowledge and understanding,
so I never understand why some people tell others to "go home" and forget
about it and others look for understanding, gain some, and gladly help
others?
Stress, I would guess, is the number one reason. I spend alot of time here
reading posts and picking up information, while helping others out when I
can. I rarely ask questions, and when I do its for clarification of
something I don't know. However, at the same time, these groups can be
vastly frustrating. Combining a failure or tough day with the java\linux
advocacy group crossposts, people who ask questions that were answered not
10 messages back, to some of the downright funny but slightly disturbing
posts that come about, such as the n-tier discussion that has been slowly
going for a while now on microsoft.public.dotnet.general I think, sometimes
you get annoyed and write and send a sharp response before you've stopped to
think.
Of course, some people are just mean.
 
Back
Top