I have encountered this so many times over the years with Winforms, and now happened to be hitting it again. My guess is that it's purely a resource problem for Visual Studio, combined with lack of error handling when the designer fails to get all memory that it's claiming.
Why:
I've tried and failed several times over the past week with a smaller-medium sized solution, but with a complex forms setup (many controls/many nested levels of tabs etc).
I just got it loading again after battling for a couple of days with failures. As I suspected memory/resources this morning I:
- shut down everything
- closed all browsers with tons of tabs
- restarted VS and closed any other bigger apps and restarted VS (VS2022 Community Edition).
- Left the computer and did some lengthy coffe brewing
.. and surprise when I got back - it loaded for the first time in 5 days.
Next time I'd hit this, what would be really interesting would be switching to another computer - if an opportunity.
@Microsoft staff in case you see this, try stress testing with low resources and see how the Forms Designer behaves.
Edit: I do not run VS as Admin.
Edit Nov/2023: have just recently switched to a clean computer, and still running vs 2022 Community Edition - a lot more robust as overall load on the machine seems to be much lower. Still Designer can fail to load some times, and that without even displaying any error message.
Creating VSCodeDomDesignerLoader
. Waited 10 minutes or more, multiple times, nothing. It's possible waiting longer would make it work as the task manager shows the SQL Server activity @HansPassant: it's not necessarily anything related to security then. – Periderm