How many assembles do we have in .NET 3.5? Can I list them down For eg: System; System.Windows.Forms and so on...Please help with code in C#
A:
What is the use of this other than being just a statistic? You do not have to include all of them in one single application anyway!
Sesh
2009-02-11 12:25:08
+3
A:
You can download the .NET Framework 3.5 Common Namespaces and Types Poster on Microsoft's website.
Eric King
2009-02-11 12:57:23
A:
Here's a quick program to search C:\Windows\assembly\
for all .dll
assemblies and output the ones with a version of 3.5
:
// Get all "*.dll" files from "C:\Windows\assembly".
string windowsDirectory = Environment.GetEnvironmentVariable( "windir" );
string assemblyDirectory = Path.Combine( windowsDirectory, "assembly" );
string[] assemblyFiles = Directory.GetFiles(
assemblyDirectory, "*.dll", SearchOption.AllDirectories
);
// Get version of each file (ignoring policy, integration, and design files).
var versionedFiles =
from path in assemblyFiles
let filename = Path.GetFileNameWithoutExtension( path )
where !filename.StartsWith( "policy" )
&& !filename.EndsWith( ".ni" )
&& !filename.EndsWith( ".Design" )
let versionInfo = System.Diagnostics.FileVersionInfo.GetVersionInfo( path )
select new { Name = filename, Version = versionInfo.FileVersion };
// Select all 3.5 assemblies.
var assembliesIn3_5 = versionedFiles
.Where( file => file.Version.StartsWith( "3.5" ) )
.OrderBy( file => file.Name );
foreach( var file in assembliesIn3_5 )
Console.WriteLine( "{0,-50} {1}", file.Name, file.Version );
Based on this PowerShell query:
dir C:\Windows\assembly -filter *.dll -recurse |
? { [Diagnostics.FileVersionInfo]::GetVersionInfo($_.FullName).FileVersion.StartsWith('3.5.') } |
% { [IO.Path]::GetFileNameWithoutExtension($_.Name) } |
? { -not $_.EndsWith('.ni') } |
sort
Also, you mind find Hanselman's Changes in the .NET BCL between 2.0 and 3.5 post useful.
Emperor XLII
2009-02-22 18:18:14