Microsoft Visual Studio gives an error while loading form in design time
if you are facing an error :
"One or more errors encountered while loading the designer. The errors are listed below. Some errors can be fixed by rebuilding your project, while others may require code changes"
while Microsoft Visual Studio loading the form in Design Time. You have to initialize all properties which belong to form.You will probably get "object reference not set to an instance of an object" in the details of the error.
Please Initialize all objects with "new" keyword or set them existance once. If you do not know main responsible of causing this error.Please follow the below to ask Visual Studio.
- Open a new Visual Studio instance.
- Open any source file. This is required to see Debug menu so that Visual Studio lets you attach to a process.
- Attach the old Visual Studio instance to the newest one. The Visual Studio process is called devenv.exe with the name of loaded project. You only need to attach to managed code. Set Visual Studio to break on Common Language Runtime exceptions - Thrown and User-handled via Debug > Exceptions
- Close the problematic form, and reopen it.
- This should result in an exception caught inside your code in the second instance of Visual Studio!
P.S:Please do not hesitate to share your comments.