Hello @harm degenaar,
I believe that the project supports code, kindly try following:
- Close VS, remove the hidden .vs folder in your solution folder, launch VS, open your project, rebuild it and check again.
- Repair VS from VS Installer > More > Repair(this takes some time).
- Try to create a new Form.cs file, copy and paste the code into this new file. Right-click your project > Add > Existing Item, select this new file and add it to your project, remove the "old" Form.cs file, see if this new Form.cs file works.
If you have tried above three methods but the error persists, please try to create a new project and let us know if the same issue exists. If the issue doesn’t appear in the new project and your project is not complex, kindly consider copying and pasting the code into the new project and use this new project.
Feel free to let us know the results.
Sincerely,
Tianyu
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.