Cool - I went through all the System namespaces and found:
Class count: 4760
Method count: 119656
The code is below. Anything I'm messing up here? Thanks again.
//***** To run this code, throw it in the button click event on a WinForm
and put a textbox on the form titled "txtOutput" *****
int intClassCount = 0;
int intMethodCount = 0;
StringBuilder sb = new StringBuilder();
string[] Ass = new string[21];
Ass[0] = "System.Configuration.Install.dll";
Ass[1] = "System.Data.dll";
Ass[2] = "System.Data.OracleClient.dll";
Ass[3] = "System.Design.dll";
Ass[4] = "System.DirectoryServices.dll";
Ass[5] = "System.dll";
Ass[6] = "System.Drawing.Design.dll";
Ass[7] = "System.EnterpriseServices.dll";
//System.EnterpriseServices.Thunk.dll
//Ass[8] = "System.EnterpriseServices.Thunk.dll"; //It coudn't find this
one.
Ass[8] = string.Empty;
Ass[9] = "System.Management.dll";
Ass[10] = "System.Messaging.dll";
Ass[11] = "System.Runtime.Remoting.dll";
Ass[12] = "System.Runtime.Serialization.Formatters.Soap.dll" ;
Ass[13] = "System.Security.dll";
Ass[14] = "System.ServiceProcess.dll";
Ass[15] = "System.Web.dll";
Ass[16] = "System.Web.Mobile.dll";
Ass[17] = "System.Web.RegularExpressions.dll";
Ass[18] = "System.Web.Services.dll";
Ass[19] = "System.Windows.Forms.dll";
Ass[20] = "System.XML.dll";
for(int intAssemblyCount = 0; intAssemblyCount < Ass.Length;
intAssemblyCount ++)
{
if (Ass[intAssemblyCount] != string.Empty)
{
Assembly a = Assembly.LoadFrom
(@"C:\WINNT\Microsoft.NET\Framework\v1.1.4322\" +
Ass[intAssemblyCount]);
//int intPropertyCount = 0;
Module[] mod = a.GetModules();
sb.Append(Environment.NewLine +"Assembly FullName: " + a.FullName);
for (int i = 0; i < mod.Length; i++)
{
Module m = mod[i];
sb.Append(Environment.NewLine + "FullyQualifiedName: " +
m.FullyQualifiedName);
sb.Append(Environment.NewLine + "Name: " + m.Name);
}
Type [] types = a.GetTypes ();
foreach (Type t in types)
{
if ( t.IsClass)
{
intClassCount++;
sb.Append(Environment.NewLine + "Class.Name: " + t.Name);
MethodInfo[] methods = t.GetMethods();
for (int i = 0; i < methods.Length; i++)
{
MethodInfo mi = methods[i];
//sb.Append(Environment.NewLine + " Method Name: " + mi.Name);
intMethodCount++;
}
}
}
}
}
sb.Append(Environment.NewLine + "Class count: " +
intClassCount.ToString());
sb.Append(Environment.NewLine + "Method count: " +
intMethodCount.ToString());
txtOutput.Text = sb.ToString();
"Jason DeFontes" <jason@defontes.com> wrote in message
news:uhXu4$SOEHA.308@TK2MSFTNGP11.phx.gbl...[color=blue]
> Yeah, I was afraid you were going to ask that. You can just figure out
> the list manually by using gacutil, or looking at the dlls in the
> framework install directory. That's no fun of course, and what you'd
> really like to be able to do is get at that programatically, which
> appears to be possible, but undocumented, and certainly is progressing a
> bit beyond the trivial:
>
>
http://support.microsoft.com/default...b;en-us;317540
>
> I found that link here, which is a nice overview of the GAC:
>
>
http://www.codeproject.com/dotnet/DemystifyGAC.asp
>
> -Jason
>
>
>
> Mark wrote:
>[color=green]
> > Great idea. I looked at the quickstart example John refered to in this
> > thread. I pasted it below. The only problem I'm seeing with reflection[/color][/color]
is[color=blue][color=green]
> > that you need to know the names of all the dlls. OR, is there a list of
> > these someplace?
> >
> > Thanks again.
> >
> > Mark
> >
> > "Jason DeFontes" <jason@defontes.com> wrote in message
> > news:%23l9K$kSOEHA.2972@TK2MSFTNGP10.phx.gbl...
> >[color=darkred]
> >>You could write a fairly trivial program that loaded all the .NET
> >>assemblies, and used reflection to count up the classes and methods. I'm
> >>too busy, or I'd do it myself for the fun of it, but it would be a good
> >>way to introduce yourself to reflection if you've never played with it
> >>before, and in itself would be a good demonstration of the
> >>sophistication of the framework.
> >>
> >>-Jason
> >>
> >>Mark wrote:
> >>
> >>
> >>>Thanks for your detailed reply. Perhaps .... out of curiosity? While[/color][/color][/color]
I[color=blue][color=green][color=darkred]
> >>>don't see the number being included in the next release of trivial[/color]
> >
> > pursuit,
> >[color=darkred]
> >>>the numbers would be intellectually interesting when describing some of[/color]
> >
> > the
> >[color=darkred]
> >>>complexities of the .NET Framework to management or others ...
> >>>
> >>>Do you have the answer?
> >>>
> >>>Mark
> >>>
> >>>"Swanand Mokashi" <swanandATswanandmokashiDOTcomNOSPAM> wrote in[/color][/color][/color]
message[color=blue][color=green][color=darkred]
> >>>news:OhZK5hQOEHA.644@tk2msftngp13.phx.gbl...
> >>>
> >>>
> >>>>why?
> >>>>
> >>>>--
> >>>>Swanand Mokashi
> >>>>Microsoft Certified Solution Developer (.NET)
> >>>>Microsoft Certified Application Developer (.NET)
> >>>>
http://www.swanandmokashi.com/
> >>>>
http://www.swanandmokashi.com/HomePage/WebServices/
> >>>>Home of the Stock Quotes, Quote of the day and Horoscope web services
> >>>>"Mark" <field027@idonotlikejunkmail.umn.edu> wrote in message
> >>>>news:OYsmhSPOEHA.268@TK2MSFTNGP11.phx.gbl...
> >>>>
> >>>>
> >>>>>I have it in my head that I saw a marketing document from Microsoft[/color]
> >
> > with
> >[color=darkred]
> >>>>the
> >>>>
> >>>>
> >>>>>total number of classes and methods in the .NET Framework. Something
> >>>
> >>>like
> >>>
> >>>
> >>>>>70,000 methods? I don't need precise numbers, but a rough estimate[/color][/color][/color]
of[color=blue][color=green][color=darkred]
> >>>
> >>>the
> >>>
> >>>
> >>>>>number of classes and methods would be useful ....
> >>>>>
> >>>>>Thanks in advance.
> >>>>>
> >>>>>Mark
> >>>>>
> >>>>>
> >>>>
> >>>>
> >>>[/color]
> >
> >[/color][/color]