Bloated Designer.cs file


Author
Message
Aaron Young
Aaron Young
Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)
Group: StrataFrame Users
Posts: 277, Visits: 1.1K
Hi guys,



This is a general observation rather than a specific SF problem.



I noticed by total accident that the designer.cs file for a relatively large form contained references to comboboxes that were no-longer displayed on the form and which I thought had long since been deleted. The form had 15 SF comboboxes but the designer file created, initialized and databound 27 comboboxes - the other 12 were never shown or used and were totally hidden. During early form development I have no doubt I added and removed the other 12 comboboxes but their references remained within the designer file for some reason. Since removing the 12 "ghost" comboboxes from the designer file, the form loads faster - dramatically so in the form designer which always stalled for 20 seconds on loading after clicking on the first field. The problem isn't only restricted to the combobox as there are numerous labels as well.



It appears Visual Studio is not very good at cleaning up the designer file. If you have a reasonably complex form which has undergone editing over a period of time, it would be worth checking the designer file if you are experiencing slow loading and stalling in the form designer.



I am off to try and find a utility which will scan the designer file and report on un-used objects. Smile



Aaron



Replies
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
I have seen this once or twice, and we have some massive forms, but generally this happens under some relatively stricti and strange conditions. Like I said, I saw this once before a while back and haven't seen it since. I think it had to do with the assembly being loaded into the AppDomain and not being dumped when run (F5) through VS while the designer is open. To prevent this, I think that if you totally close the designer and run this is less likely to happen.
Aaron Young
Aaron Young
Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)
Group: StrataFrame Users
Posts: 277, Visits: 1.1K
Ah that could explain it. I have a habit of keeping the designer open when I hit F5.



Thanks for the info - will try it and keep a lookout.



Aaron
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search