This project has moved. For the latest updates, please go here.

Best practice for debugging TFTP Server using Visual Studio 2010

Feb 6, 2013 at 1:18 PM
Hello,

I'm new to programming in C# but now I have to try to add some special functionality to your open source TFTP Server.
So far the source is looking create and I can successfully build the application using Visual Studio 2010. But I have some problems on how to best debugging the application.

As a first step I tried to add a software breakpoint in Visual Studio whenever a new download session gets started.
I rebuild the application, installed and configured it so that I'm able to download some files from a different computer. Then I wanted to attach the running process to Visual Studio in order to try to activate the breakpoints.
But the red breakpoint dots have a yellow exclamation mark that says:
"The breakpoint will not currently be hit. No symbols have been loaded for this document."

It would be great if you could provide some information on how to best debugging your application using Visual Studio.

Again thank you for thread great work so far.
Regards,
Michael
Feb 14, 2013 at 12:47 PM
I came up with a solution for myself. Just for information if anyone else is interested in it:
  1. Build projection in visual studio
  2. Install TFTP Server using PATH...\Setup\Debug\setup.exe
  3. Start TFTP Server, configure it and start the service
  4. Restart visual studio as administrator (Right click --> Run as administrator....)
  5. Open the project in Visual Studio and chose: Debug --> Attach to process
    Enable: Show processes from all useres
    Enable: Show processes in all sessions
  6. Attach to: TFTPServer.exe (User: System)
No it was possible for me to set breakpoints that were reached.

After every rebuild you have to manually stop the service, uninstall the program and reinstall it out of the debug folder.

Regards
Coordinator
Feb 28, 2013 at 4:51 PM
Hi,

I think what I would do is rewrite the .exe to run the TFTP in user space.. there's nothing particular about the code that requires it to run as a service. After that debugging becomes easy.