2

So I am currently unable to open a Form and get the following error:

System.ComponenetModel.Design.ExceptionCollection was thrown.

or:

The designer loader did not provide a root component and has not indicated why

Usually the way to solve this is to open another instance of Visual Studio with the same project, attach the debugger to the other Visual Studio and try to open the form.

However, that does not seem to be working. The debugger does not break when the error is hit, and attempting to 'Break All' at any other point does not show me the source code and just the screen saying:

Your app has entered a break state, but there is no code because all threads were executing external code (typically system or framework code).

Attempting to put break points also results in:

The breakpoint will not currently be hit. No symbols have been loaded for this document

Am I missing a setting? Incorrect Setup?

I have been battling this for half a day and thoroughly search the interwebs with no luck thus far. My designer is also fairly complex and lengthy which means trial and error is an absolute last ditch option.

Darren Shewry
  • 10,179
  • 4
  • 50
  • 46
Mr Dog
  • 396
  • 1
  • 3
  • 22
  • the exceptions tells exactly what's going on, try removing stuff from the form and see adding what provokes the error – Paweł Łukasik Jan 31 '17 at 19:18
  • @Mr Dog, it would be not the VS debugger issue, the real issue would be related to your Form which was not loaded in the design viewer. Like Paweł Łukasik, we have to find the real error code. You could comment out certain code lines, and narrow down this issue. Or just create one new form app, check it again. At least, we could know that whether it is related to the project itself or the VS IDE. Please also open it in other VS IDE, if it works well in other VS machine, maybe we would think about the VS IDE itself. – Jack Zhai Feb 01 '17 at 09:24
  • @JackZhai-MSFT I am aware it is an error in the form designer, which is why I am trying to fix it using the method stated above. But I am unable to get that method working. It is not practical for me to remove lines and test the form as the designer is more than 7000 lines long. – Mr Dog Feb 01 '17 at 14:38
  • Might I suggest you add the New function to your form, if it isn't already there, and add an error handler to the function so it covers the normal initialization code. then break on the exception and check the stacktrace. Public Sub New() Try InitializeComponent() Catch ex As Exception Debug.Print(ex.StackTrace) End Try End Sub – Trevor_G Feb 03 '17 at 01:20
  • If that just reports and error at the InitializeCOmponent function you may need to add the handler to the actual function in the designer. But hopefully it will help you identify the line causing the issue. – Trevor_G Feb 03 '17 at 01:29
  • Try to disable "just my code" option in Debug-->general setting, may allow you to see what code is causing the exception if it is not your code(unlikely). – Duly Kinsky Feb 03 '17 at 01:29

1 Answers1

1

First attempt to resolve:

you may have tried it already. Right click the Solution in solution explorer, click "clean solution", this deletes all the compiled and temporary files associated with a solution.

Do a rebuild of the solution and try to debug again.

Second attept to resolve:

Start debugging, as soon as you've arrived at a breakpoint or used Debug > Break All, use Debug > Windows > Modules. You'll see a list of all the assemblies that are loaded into the process. Locate the one you want to get debug info for. Right-click it and select Symbol Load Information. You'll get a dialog that lists all the directories where it looked for the .pdb file for the assembly. Verify that list against the actual .pdb location. Make sure it doesn't find an old one.

In normal projects, the assembly and its .pdb file should always have been copied by the IDE into the same folder as your .exe. The bin\Debug folder of your project. Make sure you remove one from the GAC if you've been playing with it.

third attept to resolve:

Disable the "Just My Code" option in the Debug/General settings.

there are might be other causes to your problem, i picked them from here. you may try other solution to try resolve your issues. Fixing "The breakpoint will not currently be hit. No symbols have been loaded for this document."

Community
  • 1
  • 1