-
Notifications
You must be signed in to change notification settings - Fork 357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows Form designer does not save changes #180
Comments
Thanks for reporting the issue. Unfortunately I have been unable to reproduce it so far. Some additional information that may help:
|
No matter what I do from then on, any changes, whether they are property changes or adding controls, will not be preserved. I don't know if it worked with a different version, sorry. :) |
I've had difficulty reproducing this consistently, but I have seen it twice now. Investigating.. |
I have a hunch.. can you please try disabling the following CodeMaid option, and let me know if you are still able to reproduce the issue? Remove->"Remove end of file trailing new line" Once I disabled this setting, I was no longer able to reproduce the issue. That same setting has a known workaround for C++ resource files and I'm wondering if the same is needed for VB. |
I am using C#, does this matter? |
That's good to know.. not sure why I got VB in my head. Same question still applies though, does removing that setting resolve the issue for you? |
I disabled "Remove end of file trailing new line". The issue still occurs. |
How reliably are you able to reproduce it? I saw it about half the time with VB, and never with C#. If you can consistently see the issue, here's what you could do to help isolate the issue: Export your CodeMaid settings. That's the approach I took that took me to a specific setting with VB which I'll continue to investigate. When you're done you can import your settings to get back to a clean slate. In particular I would recommend focusing on the 'Visual Studio' configuration options followed by the 'Remove' cleanup actions. |
I can reproduce it every time. I'll try to find the culprit setting. |
Hmm, well, that's interesting. I reset to defaults in CodeMaid and set it up again and now it's working perfectly. I have attached my old and new settings. |
Resetting to defaults would have turned off automatic cleanup on save. I bet with that disabled you won't see any issues as CodeMaid won't be running a cleanup as the designer saves updates. |
I turned it back on after I reset. |
I have no idea what it was (maybe something from an older version?). |
I have found the culprit: Reorganizing->"Run reorganize at start of cleanup". Once I enable it, designer changes are not preserved. Disabling it allows changes to be saved. |
That makes a lot of sense, thanks for discovering it. I should be able to look at it further over the holiday weekend. |
Unfortunately even with importing your old settings I'm still unable to reproduce the issue. Re-reading some of the original comments to see if I'm forgetting anything you mentioned a debugging session on the original report, but it's not in the steps to reproduce. Is that something you found wasn't required to exhibit the issue? I'm following the steps to reproduce as written (e.g. never closing the code window). |
Closing due to inactivity. Please feel free to comment and we can reopen this issue. |
I've now reproduced the issue based on the additional information. I've confirmed this issue is tied to the combination of enabling all of the following settings:
These options were all enabled in the OP's settings as well. The designer file contains a Investigating further. The .designer.cs file itself shouldn't(tm) be touched based on default cleanup exclusions.. |
Confirmed the .designer.cs file is not being touched by CodeMaid, which is correct behavior as it is listed in the exclusions. The Form class will contain a default constructor in order to call The list of above settings should also include: |
…ng as an active code view is required for successful cleanup.
I've found that this issue occurs when you trigger the save with the designer window active, but not when you trigger the save with the code window active. We generally try to enforce that a code window is open and active as several of the cleanup commands require that to run successfully. It appears that cleanup is running improperly when the code file is in the background or not open at all. The straight forward fix I've just pushed is that when the designer window is active, saving the file will not cause the code to be cleaned. The code window will have to be active for cleanup to proceed. There wasn't any good way to distinguish the two window types through the API other than by the file caption which is hacky, but functional. This fix will be present in the next release, thanks again @DarkfireHellspawn and @Andy65 for all the help tracing it down. |
This fix is now available in the latest beta here: https://github.com/codecadwallader/codemaid/releases/tag/v0.9.0.2-beta If anyone has a chance to test and confirm the fix it would be greatly appreciated. If there are any issues please comment and we'll reopen the issue. |
Hi,
I am facing a problem where the Windows Form designer does not save changes and resets the form back to the previous state.
This only occurs after the first debugging session. If I disable the CodeMaid extension it works perfectly.
I am using Visual Studio 2015 on Windows 10 x64.
Thanks.
The text was updated successfully, but these errors were encountered: