Exploring the Code for the New .NET 3.5 Classes

Posted by: Scott on Writing, on 14 Feb 2008 | View original | Bookmarked: 0 time(s)

I often use the free and awesome decompiler Reflector to peer into the source code of Microsoft's .NET Framework. It's an indispensable tool. However, I had a little difficulty viewing the underlying source code for some of the new .NET 3.5 classes. In particular, for a recent article I was interested in looking at what was happening underneath the covers when the DataPager control was rendered. The DataPager is a new control in ASP.NET 3.5 used to render a paging interface for the ListView control (also new to 3.5).

By default, Reflector had the v2.0 assemblies loaded. No problem, I thought, I'll just navigate to the 3.5 assemblies in the %WINDIR%\Microsoft.NET\Framework folder and open the System.Web assemby from there. While there is a 3.5 subfolder there, it only includes a sprinkling of assemblies, and none of the 3.5 assemblies I was interested in. The .NET 3.5-specific classes are installed in the GAC in the System.Web.Extensions.dll assembly. Reflector, it appears, can't locate this assembly and I couldn't reach it through Windows Explorer.

I was able to use Reflector to dig into this assembly, but I'm sure there's an easier way to do it. I'm going to share my approach, but I invite anyone who knows of a simpler technique to post instructions in the comments. One possible solution would be to update Visual Studio 2008 so that the .NET Framework code can be stepped into during debugging. I tried applying thehotfix a while back and got an error, and havenot yet taken the time toinvestigate the errorfurther.With the .NET Framework source code integration can you view the source code through VS 2008 like with Reflector, or isthe codeonly accessible when debugging?

To open the System.Web.Extensions.dllfrom Reflector, perform the following steps:

  • Drop to the command line (Start / Run / cmd.exe)
  • Navigate to the appropriate GAC folder, %WINDIR%\assembly\GAC_MSIL\System.Web.Extensions\\
  • Copy the System.Web.Extensions.dll to another location on my hard drive (such as C:\MyAssemblies\).
  • Once theassemblyis freed from the GAC, you can open it in Reflector asyou would any assembly

Hope this helps!

Category: .NET | Other Posts: View all posts by this blogger | Report as irrelevant | View bloggers stats | Views: 841 | Hits: 22

Similar Posts

  • New Entity Framework Feature CTP for VS2010 Beta 2 more
  • Using SqlBulkCopy To Perform Efficient Bulk SQL Operations more
  • Avoid Entrenched Dependencies more
  • The Telerik CAB Enabling Kit and SCSF - Tutorial 5: The RadPanelBar UIExtensionSite more
  • Silverlight: RadChart for Export to Image more
  • Visual Studio Add-In vs. Integration Package Part 1 more
  • RadFormDecorator is Getting Even More CSS3 more
  • Next version of EF Code Only Design laid out by MS more
  • Building Advanced Layouts With RadSplitContainer more
  • An Overview of Partial Classes and Partial Methods more

News Categories

.NET | Agile | Ajax | Architecture | ASP.NET | BizTalk | C# | Certification | Data | DataGrid | DataSet | Debugger | DotNetNuke | Events | GridView | IIS | Indigo | JavaScript | Mobile | Mono | Patterns and Practices | Performance | Podcast | Refactor | Regex | Security | Sharepoint | Silverlight | Smart Client Applications | Software | SQL | VB.NET | Visual Studio | W3 | WCF | WinFx | WPF | WSE | XAML | XLinq | XML | XSD