I Saved C# Project form as a new name, now project is broken. How to fix it?

Clay LaHatte 0 Reputation points
2024-03-05T02:56:24.25+00:00

I have a C# project in Visual Studio Community 2022 with a single form for the interface. I made some changes to the form and wanted to save it as a different name so I could preserve the previous design. Now I cannot see the form in the designer, but instead a windows with the message ...

"To prevent possible data loss before loading the designer, the following errors must be resolved: "

Can anyone explain how to resolve this?

UPDATE: I was able to get back to normal by renaming the filename extensions of the new .cs and .resx files. VS should be better than this.

Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,873 questions
Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,887 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Jiale Xue - MSFT 43,046 Reputation points Microsoft Vendor
    2024-03-05T09:46:50.06+00:00

    Hi @Clay LaHatte , Welcome to Microsoft Q&A,

    So the solution to this problem is:Renaming the filename extensions of the new .cs and .resx files.

    Best Regards,

    Jiale


    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.

    0 comments No comments