Open .NET form in designer mode - get “The path is not of a legal form”


I attempted to open a C#/VB form in designer mode, and instead of the form, I got an ugly error message saying "The path is not of a legal form". This form used to work! What happened?

Thanks to all who have answered. This question is a problem I hit a while back, and I struggled with it for a long time, until I found the answer, which I posted below in order to help other people who might have hit this problem.


This problem happened with me, and I found out it is because of bad reference. You have to review the assemblies that your application references.

By : Michel

By path, it might be referring to a path to a file or folder. There could be a malformed path that you are trying to reference, i.e. forward slash instead of backslash. Also, what changed since the error came up? Did you move any files around? Did you save any previously unsaved code? Update from a version control system?

Debugging design mode would help. From here:

  1. List item
  2. In visual studio, select the project you want to debug.
  3. Right click -> Properties.
  4. Select the debugging tab.
  5. Change the debug mode to Program.
  6. Set the “Start Application” to be your visual studio IDE (C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE\devenv.exe)
  7. Set your solution file in the “command line argument field”.
  8. Apply -> OK
  9. Select the project you want to debug as the startup project.
  10. Run.
  11. Set a break point in the place you want to start debug (for example, your control constructor)
By : jfs

This video can help you solving your question :)
By: admin