dotnet / dotnet/project-system
Error when renaming an unsaved C# WinForms form.
- Dominant language
- C#
- Stars
- 1k
- Forks
- 415
- PR merge metrics
- No merged PRs in 30d
Description
## Visual Studio Version
Visual Studio 2022 17.7 Preview 1
(Reported since Visual Studio 2019 in this [feedback ticket](https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1297172))
## Summary
While having a form open with some unsaved changes in place, renaming the file will cause a "catastrophic" error to occur.
## Steps to Reproduce
1. Download the project attached in the feedback ticket.
2. Open and add a button into the form designer.
3. Don't save the project, right click Form1.cs in Solution Explorer, rename it to Form2.cs
4. Try to save the project.
## Expected Behavior
This is what _I think_ should happen, but might not be accurate: the form is saved and then renamed to Form2.cs.
## Actual Behavior
An error dialog pops up when saving the .NET Framework project that is based on the new SDK style after renaming Form1.cs.

Contributor guide
Assessment
This issue has not been assessed yet.