Şu sıralar Visual Studio 2008 ile birlikte gelecek olan, debug işlemleri sırasında framework'ün kodlarını da debug edebileceğimiz haberi herkesi heycanlandırıyor. E güzel gelişme tabiki.

Peki bu yenilik gelmeden önce napıyorduk ? Ya da debug işlemlerine açılması planlanan DLL'ler dışında bir Dll'i debug etmek istersen ne yapabiliriz? Diğer bir amaç ise projemizde kullandığımız 3. parti Dll'leri - kodları bizde olmayan- debug etmemiz olabilir.

Bildiğiniz üzere nerdeye dünyanın ençok kullanılan decompiler aracı olan Reflector AddIn altyapısı sayesinde birçok geliştirici eklemeler yapabiliyor bu uygulamaya. Bunların arasında en güzellerinden bir tanesi de Deblector. Kısa deblector sayesinde reflector'ü kullanarak bir uygulamayı debug edebiliyoruz.

İlgili linklerden Reflector ve Deblector uygulamarını indirdikten sonra reflector uygulamasının View->Add Ins.. menüsünden ilgili plugin'i eklememiz gerekiyor.

Şimdi küçük bir uygulamayı debug etmeye çalışalım. Örnek olması açısında aşağıdaki basit kod üzerinden açıklamay yapmaya çalışacağım

        private void button1_Click(object sender, EventArgs e)
        {
            SqlConnection con = new SqlConnection("data source=.;database=Northwind;user id=sa;pwd=1");
            SqlCommand cmd = new SqlCommand("select * from Categories",con);
            DataTable dt = new DataTable();
            SqlDataAdapter da = new SqlDataAdapter(cmd);
            da.Fill(dt);
            MessageBox.Show(dt.Rows[0][1].ToString());

        }

Amacımız Debug işlemi sırasında SqlDataAdapter nesnesinin varsayılan yapıcı metodunu (Default Constructor) incelemek (Bunu Visual Studio kullanarak yapabilmemiz imkansız). Reflector uygulaması açıp Tools menüsünden Deblector'ü aktif hale getirdiğimizde sağ tarafda yeni bir bölüm, toolbar da debug işleminde kullanacağımız butonları görebiliriz.

Şimdi File->Open menüsünden debug etmek istediğimiz uygulamayı seçip işlemlerimize başlayabiliriz.

Sol tarafdaki Tree'den reflector_text.exe yi seçip F7 ile uygulamayı - ya da toolbardan ilgili butona tıklayarak - debug işlemini başlattımızda (aynı zamanda reflector_test.exe nin çalıştırıldığına da dikkat edelim)yukardaki gibi bir ekran ile karşılaşıyoruz. Sarı ile işaretlenmiş IL kısmı o anda hangi satırı debug ettiğimizi göstermekte, istenirse yukardaki kısımdan ilgili kod bloğunun C#  karşılığını da görebilmekteyiz. Alltaki siyah - Shell - kısımda ise o anda hangi satırın debug edildiğini görebilmekteyiz. Visual Studio'dan alışık olduğumuz  F10 ile satır satır ilerleyebilir, F11 ile de o anda debug edilen metodun içerisine girerek işlemlerimize devam edebiliriz.

Sol Tree'den button1_click metodunu seçip breakpoint - toolbardaki kırmızı ikon - koyarak debug işlemini başlatalım.

Çalışan uygulamamızda button1 e tıkladığımızda breakpoint koyduğumuz yerde bizden komut beklemeye hazır durumda olduğunu göreceksiniz.Artık F10 ya da F11 ile kodları debug etmeye başlayabiliriz.

 


 
Sunday, November 11, 2007 4:10:38 PM (GTB Standard Time, UTC+02:00)
Hocam selamlar,

Reflector e bu add-in i eklemek istediğimde "failed" mesajı veriyor. AV vs leri de kapatıp denedim ama olmuyor bir türlü. Ben de reflector un en güncel hali var. Nedendir acaba?

Yeni konularınızı 4 gözle bekliyoruz.

Selam ile,

Thursday, February 07, 2008 2:03:54 AM (GTB Standard Time, UTC+02:00)
http://www.codeplex.com/NetMassDownloader adresinden indireceginiz program ile butun source code'u tek seferde indirebilir ayni zamanda vs2005 altinda debug edebilirsiniz.

Arkadaslar asagida gelistirmis oldugum proje ile source code'u visual studio kullanmadan indirebilirsiniz.
Ayrica bununla VS2005'tede .net frameworku debug edebilirsiniz.


http://www.codeplex.com/NetMassDownloader

.NET Mass Downloader

Welcome to the .NET Mass Downloader project. While it’s great that Microsoft has released the .NET Reference Source Code, you can only get it one file at a time while you’re debugging. If you’d like to batch download it for reading or to populate the cache, you’d have to write a program that instantiated and called each method in the Framework Class Library. Fortunately, .NET Mass Downloader comes to the rescue!

Using .NET Mass Downloader
Open a command or PowerShell prompt and navigate to where you extracted the current release. The tool itself is NetMassDownloader.exe and when run without parameters shows the following help screen:
.Net Mass Downloader 1.0.0.0 - (c) 2008 by Kerem Kusmezer, John Robbins

Batch download the Microsoft .NET Reference Source code.

Usage: NetMassDownloader [-file <file>]
[-directory <directory]
[-output <directory>]
[-vsver <version>]
[-force] [-nologo] [-verbose] [-?]

-file - Download an individual file's PDB and source code. You can
specify multiple file parameters. (Short -f).
-directory - Download all the found PDB and source code for all files in
the specified directory. You can specify multiple
directory parameters (Short -d).
-output - The output directory for PDB and source files. The default
directory is the cache directory set in Visual Studio 2008.
By using the cache directory, you'll have the PDB and source
files available to Visual Studio 2008. However, to use the
.NET Reference Source Code with VS 2005, use the -output
switch and in the Options dialog, Debugging, Symbols property
page, add the specified output directory to the "Symbol file
(.pdb) locations." Also, add the directory to the Solution
Properties, Common Properties, Debug Source Files, Directories
containing source code location. The Visual Studio 2005
debugger will automatically load the source code. (Short -o)
-vsver - The Visual Studio version number to use for finding the cache
directory. The default is Visual Studio 2008,
but if you want to use the cache directory for Visual Studio
2005, you would pass '-vsver 8.0' (without quotes) (Short -vs)
-force - If specified, forces the downloading the PDB files into the
symbol server. When downloading to a symbol server if the PDB
exists, it's not downloaded. Using the -output switch will
always download and process the PDB. (Short -fo)
-nologo - Don't show the logo information. (Short -n)
-verbose - Do verbose output. May be worth turning on as the downloading
source code can take a long time. (Short -v)
-? - This help message.
The only required arguments are –file or –directory, both of which can be specified as many times as you’d like. When you specify a directory, only the .DLL and .EXE files from that directory will be processed. If you wanted to download all the source code from binaries in the .NET 2.0 32-bit and 64-bit directories, the command line you’d pass is: -d C:\Windows\Microsoft.NET\Framework\v2.0.50727 –d C:\Windows\Microsoft.NET\Framework64\v2.0.50727.

The main purpose of Net Mass Downloader is to populate the source code download cache for debugging, the default download location is the cache you specified to Visual Studio 2008. The –vsver switch to account for future Visual Studio versions so Mass Downloader could work with future CTPs and versions.

While it’s great to see the .NET Reference Source Code in Visual Studio 2008, there are a lot of developers out there who can’t upgrade yet, but would love to be able to debug into the .NET Reference Source Code. If you specify the -output parameter, the PDB and .NET Reference Source Code will be written to the specified directory. In Visual Studio 2005, place that directory in the Options dialog, Debugging, Symbols property page. In the “Symbol file (.pdb) locations” list box as the first item. Also in the Options dialog, Debugging, General property page, uncheck "Require source files to exactly match the original version." Finally, in each Visual Studio 2005 project go into the solution property pages, Common Properties, Debugging Source Files, and in the "Directories containing source code" add the output directory to the top of the list. That's enough for Visual Studio 2005 to debug into the .NET Reference Source Code.

When you first run Net Mass Downloader, you will be prompted with the current EULA for accessing the source code. If you don’t agree with the Microsoft EULA, clicking the Decline button will not download the source code.

The code download includes a detailed documentation about the steps required to use it with VS2005

If none of the files can be downloaded please download and install the RTM Version of the .NET Framework 3.5

According to the Shawn's blog the following DLLs are enabled for the .NET Reference Source Code:
Mscorlib.DLL
System.DLL
System.Data.DLL
System.Drawing.DLL
System.Web.DLL
System.Web.Extensions.DLL
System.Windows.Forms.DLL
System.XML.DLL
WPF (UIAutomation.DLL, System.Windows.DLL, System.Printing.DLL, System.Speech.DLL, WindowsBase.DLL, WindowsFormsIntegration.DLL, Presentation.DLL, some others)
Microsoft.VisualBasic.DLL

Net Mass Downloader will download any additional DLLs Microsoft configures to use with .NET Reference Source Code in the future, provided Microsoft doesn't change the download engine.

The original .NET Reference Source Code announcement can be found here:
Shawns Announcement


Downloading .Net Framework 3.0 And 3.5 Libraries

The framework v3.5 and v3.0 assemblies are located under c:\program files\reference assemblies\microsoft\framework\v3.0 and c:\program files\reference assemblies\microsoft\framework\v3.5

so to download them issue the following command pointing netmassdownloader to target folders:

netmassdownloader -d "C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5"
-d "C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0"

Check the discussion How to download v3.0 and v3.5 Source Codes about this.


Acknowledgements
Thanks to the Developer Division at Microsoft. First they released the .NET Reference Source Code, and second for allowing a couple of developers to have some fun and provide a utility for the community. Thank you for using .NET Mass Downloader. We just ask that you log any bugs and features into the project Issue Tracker.


Contact Information
You can reach us via the discussions or you can directly mail Kerem at keremskusmezer@gmail.com


Development Details
If you have questions about particular pieces of the code, Kerem Kusmezer did the following parts: the PE (Portable Executable) Parser, the PDB Parser, the Webclient Class. and the SrcSrv class. John Robbins did the console driver, testing, and served as Kerem's code monkey.

Kerem Kusmezer and John Robbins
Sunday, May 24, 2009 5:36:45 PM (GTB Daylight Time, UTC+03:00)
Sorry. Challenge is a dragon with a gift in its mouth?Tame the dragon and the gift is yours. Help me! I can not find sites on the: Turbo Tax. I found only this - <a href="http://turbo-tax.biz">turbo tax</a>. Drug addiction treatment referral for alcoholism, drug rehabilitation. Posted friday, march center for substance abuse treatment csat hazelden corporation. Thanks for the help :o, Sidonia from Ecuador.
Sunday, November 01, 2009 3:09:54 AM (GTB Standard Time, UTC+02:00)
Thanks for article. Everytime like to read you.
Friday, November 06, 2009 3:21:07 AM (GTB Standard Time, UTC+02:00)
Do you want to buy some sheepskin boots, please come to www.findugg.com.Full range of UGG boots for Men and Women to buy online. Fast and free shipping to worldwide, competitive price, high quality, and efficient service.

Read more:http://www.findugg.com
Monday, November 09, 2009 2:42:07 AM (GTB Standard Time, UTC+02:00)
Ugg boots are a style of <a href="http://www.gouggs.com/products_all.html">sheepskin boot</a>,with wool as the inner lining and a tanned outer surface worn by both men and women. <a href="http://www.gouggs.com/ugg-cardy-boots-c-2.html">UGG shoes boots</a> often have a synthetic sole, although this is not universal. Uggs have been identified as a fashion trend for <a href="http://www.gouggs.com/ugg-short-boots-c-1.html">men UGG Short Boots</a> and <a href="http://www.gouggs.com/womens-c-17.html">Womens UGG Boots</a> since the early 2000s. In late 2008, <a href="http://www.gouggs.com/ugg-bailey-button-c-10.html">UGG Bailey Button</a>grew again in popularity with men as male celebrities were seen in them.
Saturday, November 21, 2009 2:45:34 PM (GTB Standard Time, UTC+02:00)
Do you want to buy some <a href="http://www.findugg.com/products_all.html">sheepskin boot</a>,come to <a href="http://www.findugg.com/">www.findugg.com</a>.Full range of UGG boots for Men&<a href="http://www.findugg.com/ugg-womens-c-17.html">women</a>to buy online. Fast and free shipping to worldwide, competitive price, high quality, and efficient service.

Read more:http://www.findugg.com or http://www.bootshotsale.com
Thursday, November 26, 2009 7:25:51 AM (GTB Standard Time, UTC+02:00)

<a href="http://www.gouggs.com/">Ugg Australia</a> Brand by the American company Deckers is a popular maker of Ugg Boots and fashion footwear. As we specialize in Australian made <a href="http://www.gouggs.com/">Ugg Boots</a> we do not sell Ugg Australia brand boots on this site but due to popular demand we can offer Ugg Australia Brand at our affiliated site: www.e-uggs.com;UGG New Style Boots are made from the <a href="http://www.gouggs.com/">highest quality plush twin-faced sheepskin</a>with craftsmanship you expect from UGG Australia.100% premium
Sunday, November 29, 2009 6:01:44 PM (GTB Standard Time, UTC+02:00)


I received my<a href="http://www.mytobling.com/ugg-ultra-short-

boots-c-42.html"><strong> ugg ultra short</strong></a> today, very

impressed. They are like sort of a massive slipper, soft, easy to

wear and light.
GREAT <a href="http://www.mytobling.com/ugg-ultra-tall-boots-c-

43.html"><strong>ugg ultra tall</strong></a> THANK YOU QUICK

SERVICE.
Name
E-mail
Home page

Comment (HTML not allowed)  

Enter the code shown (prevents robots):

Live Comment Preview