0

I have some issues with my Windows Forms UserControl and am unable to place it in a form. I'm trying to find the problem using design time debugging with devenv.exe but whatever I try, breakpoints are ignored. At first I had the "breakpoint will not be hit, no symbols for this document" warning but I fixed it and now there is no warning.

I know this has been answered may times, but none of these have worked for me and all out of options

  • Enabling DEBUG constant
  • Setting debug info to full
  • Disabling Just my code
  • Making sure the breakpoint is in the right place to be hit
  • Making sure I use the debug option before launching
  • Making sure I'm attached to the right process (there is only one available)
  • Setting the project as startup
  • Running VS as an administrator
  • Disabling Step over properties and operators
TheBoxyBear
  • 371
  • 2
  • 15

1 Answers1

-1

Try these:

Make sure that you used Debug configuration to debug your project.

1) reset vs settings under Tools-->Import and Export Settings--> reset vs settings

2) close Vs, delete .vs hidden folder under the solution folder, bin and obj folder.

Also, Windows Forms UserControl project is a class library project, and it cannot set up to debug directly. You should create a console or windows form exe project and then reference the Windows Forms UserControl project, after that, initialize the class with class_name xxx=new class_name();, set a breakpoint on that. At last, set the new exe project as a startup project and then test it.

3) when you are debugging, please enter Debug-->Windows-->Modules and check if your <user_control_project_name>.pdb file is loaded, if not, you could right-click on it to Load Symbols.

Sara Liu - MSFT
  • 6,007
  • 1
  • 21
  • 27
  • My project is setup to launch devenv.exe aka Visual Studio to debug the designer, essentially Visual Studio debugging itself using another instance. My UserControl is a WinForms app project, not a library. – TheBoxyBear Apr 16 '21 at 14:15
  • How did your command look like? Did you check if the Modules window has the pdb file? – Sara Liu - MSFT Apr 22 '21 at 09:44
  • No command, just set the launch option to Executable and gave it the full path of devenv.exe – TheBoxyBear Apr 22 '21 at 18:56