What's Hot

Get Source for the Framework

Microsoft's releasing some .NET 3.5 Framework swag: deployment guidelines and the source code itself.

Microsoft has released two guidelines for the deployment of the .NET 3.5 Framework: one for application developers and one for administrators. The developers guide includes details for determining what version of the Framework is installed and information on installer error codes and command-line switches. You can choose to chain the dotNetFx35Setup.exe (2.7MB) with the /q /norestart switches as part of your install, and the dotnet setup will check for the relevant bits and download them if necessary. Alternatively you can chain the full dotNetFX35.exe and avoid downloading from the Internet; the catch is that the dotNetFX35.exe is 197MB to distribute.

The guide also provides details on extracting the modules out of the dotNetFx35.exe, so you can distribute the most common ones along with the dotNetFx35Setup.exe. The setup program will check for modules in its path and download only missing modules from the Web if needed. You can download the dotNetFx35Setup.exe here and find the full distribution (dotNetFx35.exe) on the same page. The administrator's guide provides details on running network installs of the Framework, including Active Directory. The guide also provides a sample script.

The exciting news for the month is Microsoft has also begun to provide the source code for the .NET Framework for debugging purposes. You can step through your code and into the Framework code, which comes complete with extensive comments. Only some of the libraries have been released at present: Mscorlib.dll, System.dll, System.Data.dll, System.Drawing.dll, System.Web.dll, System.Web.Extensions.dll, System.Windows.Forms.dll, System.XML.dll, UI-Automation*.dll, System.Windows.dll, System.Printing.dll, System.Speech.dll, WindowsBase.dll, WindowsFormsIntegration.dll, Presentation*.dll, and Microsoft.VisualBasic.dll.

To use the source code, you need to turn off "Enable Just My Code" and turn on "Enable Source Server Support" in Visual Studio's Options under Debugging – General. Next, go to the Debugging – Symbols panel, add the symbol source location of http://referencesource.microsoft.com/symbols, and provide a local cache path to save the symbols in.

Microsoft's general recommendation is that you check "search the above locations only when symbols are manually loaded." This means you won't step into the .NET Framework code until you load the symbols for the library in question. You can right click on the library in the "Modules" window and choose "load symbols." If you get prompted for a path for the symbols file, that means the library isn't available from the source code server.

You probably won't want to step into the Framework code all the time; this can be a tedious task to see just how many calls occur below your code. But when you're having trouble with one part of your application or are unsure about the ramifications of a Framework call, then the source code with comments can be a great help.

You can find more information on configuring Visual Studio to debug the .NET Framework source here.

About the Author

Bill McCarthy is an independent consultant based in Australia and is one of the foremost .NET language experts specializing in Visual Basic. He has been a Microsoft MVP for VB for the last nine years and sat in on internal development reviews with the Visual Basic team for the last five years where he helped to steer the language’s future direction. These days he writes his thoughts about language direction on his blog at http://msmvps.com/bill.

comments powered by Disqus

Featured

Subscribe on YouTube