jordanz
jordanz

Reputation: 373

How do I fix the error "An error occurred in {solution name} while attempting to open {form}"

I am not a very experienced programmer, but have recently developed some basic WinForms apps for work using Visual Studio 2019. I have just started creating another app (using .NET 5.0) that currently contains two forms and some class files. Whenever I open the solution, at least one of the forms pops up the error "An error occurred in {solution name} while attempting to open {form}". The effected form seems to change each time I reopen the file; for example, if I open the solution and it is already on form 1, form 1 will behave as expected, but form 2 will display the error. The opposite happens when the roles are reversed as well.

I have tried many of the fixes that are present in answers to similar questions: delete the "bin" folder, unload/reload the project, search for duplicate variable names, restart visual studio and the computer, even revert back to an old version of the solution. However, the error still persists. Closing the affected form and reopening it allows me to continue working on it, but the error still appears either randomly while working or when I start the project again.

This could very possibly be a simple solution, but I cannot think of other things to try.

Here's a screenshot of the error message:

enter image description here

Upvotes: 1

Views: 1794

Answers (1)

jordanz
jordanz

Reputation: 373

After several weeks/months of working on the project, the errors just stopped appearing. Not sure what the potential fix was or could be.

Upvotes: 0

Related Questions