Debug program in SharpDevelop
SharpDevelop is an open source C # integrated development environment that can be downloaded to the source code and binary executables at http://sourceforge.net/project/showfiles.php?group_id=17610&package_id=117376. The latest version is version 1.0.3.1768.
The installation is still very simple, just follow the prompts, it is OK, and it can be installed for 1 minute, compared to the vs.net2003 is much faster (because it does not contain installation .NET Framework and SDK, of course, can run the program These two things should be installed in advance), after opening, feelings like VS.NET2003.
Create a new WinForm program, basically, as long as you use vs.net2003, you can quickly get started.
But compared to VS.Net 2003, SharpDevelop still has a lot of shortcomings:
1. SHARPDevelop, the memory resources are more than the vs.net2003, and write a little program, accounting for 75M memory.
2. SHARPDevelop cannot modify the file name in the Project panel, this is very troublesome, I am in entering the file name of the CS file in Go to the directory, open SharpDevelop with notepad XXX.PRJX, replacing the CS file name and resource file file name.
3. When SHARPDevelop's code Auto Complete, you cannot display a comment, attribute, etc.
4. The biggest shortcoming of SharpDevelop is that it is not possible to debug code, and there is no point to break. There is an old idea in the SharpDevelop forum. "SharpDevelop is like a car without wheels." Indeed, there is no debug function, it is clear that after viewing the information, you know that SharpDevelop version 1.0 will not contain debugging, because debugging features are not a simple thing, use some unsafe code, but debugging The code write is currently in progress. Fortunately, the people on the forum have provided some alternative debugging programs - using Microsoft's dbgclr.exe, I tried it, still very easy to use, let's introduce the current SharpDevelop debugging:
[MSDN] Open / hide
CLR debugger
The Microsoft CLR debugger provides a graphical interface for debugging services to help application developers discover and fix errors in programs that are running to the public language. The CLR debugger and the included document are based on the work that is done for the Microsoft Visual Studio .NET debugger. Therefore, the document mainly involves the Visual Studio debugger instead of the CLR debugger. In most cases, this information applies to both debuggers. However, you will find that some of the functions described in the CLR debugger (see the next paragraph). You can ignore these features and some. Below is some of the main differences between the CLR debugger and the Visual Studio debugger described in the document:
The CLR debugger does not support debugging Win32 native code applications. The CLR debugger can only debug the application that is written and compiled for the public language runtime. Remote debugging is not implemented in the CLR debugger. The Register window is implemented in the CLR debugger, but registration information is not displayed in this window. Other operations involving registers or pseudo registers are not supported, such as displaying or changing register values. The "Anti-Distribut" window is implemented in the CLR debugger, but if the application is compiled as Win32 native code instead of a public language runtime code, the window displays the disassembly code generated by the application. The CLR debugger does not support F1 help. The CLR debugger does not support the "Auto" window feature. The CLR debugger solution model CLR debugger uses solutions to associate the source file and the application that is debugging. The solution is automatically created when you open the compiled application and its associated source file. When you debug the same application next time, you can open the solution without having to load source files and compiled applications. Open the app to debug (for the first time)
Start the CLR debugger; run dbgclr.exe, which is located in the GuideBug directory installed in the .NET Framework. From the "Debug" menu, select "Programs you want to debug". In the "Programs you want to debug" dialog, go to the Programs box, and then click the ingredient button (...). The "Programs" dialog for finding to be debugged is displayed. Located to the directory containing the EXE to be debugged and selects the EXE. Click "Open". This will enable you to return to the "Programs you want to debug" dialog. Note that the "Work Directory" has been set to include the directory of your EXE. In the Parameters box, type any parameters required by the program. Click OK. From the File menu, select Open, and then click File. In the Open File dialog, select the source file you want to open. Click OK. To open another source file, repeat steps 8-10. This process automatically creates a solution for your debug session. If you select "Start" or "Sentence", open the "Save File as" dialog so you can save the solution. If you select "Exit" or "Close Solution", a message box will be displayed prompt you to save the solution. Open an existing solution
Select "Open" from the File menu. Open / hide
You can add DBGCLR.EXE to the Tool menu of SharpDevelop, it is convenient to start in the future:
· Add a new Tool (Tools-> Options-> Tools-> External Tools-> Add) · That's name "Debugger" or other similar name · Fill in the path to DBGCLR.exe in the Command box (usually in C: / Program files / microsoft.net / sdk / v1.1 / guidebug / dbgclr.exe) · Click Ok Button
Note: DBGCLR and SharpDevelop are not dependent on each other, even if there is no SharpDevelop, you can also debug code according to the method mentioned above [MSDN].
In fact, there is also a method of automatically launching the debugging environment. It is to add a code before the code to debug: system.diagnostics.debugger.break (); the code is running here automatically jump out of the dialog box, let you choose the debug tool:
Then you can debug with F10, F11.
SHARPDEVELOP, is still a very good tool, the general function is, the most important thing is that it is not worthy. Now SharpDevelop or 1.0 version, I believe it is more powerful after the 1.5 or version 2.0, after adding the debugger, it will be more powerful.