Reputation: 5550
whenever i use xaml editor designer mode, there will be an instance of XDesProc.exe at Windows Task Manager and it consume very high memory that eventually make the application hangs while i debug.
What I usually do is i will kill it at Task Manager and the program can continue running but designer view will be gone. This problem only exist at particular project but I've no idea where to trace the problem. Any wild guess?
Upvotes: 2
Views: 788
Reputation: 13
Short Answer:
Turn off the XAML designer in the options.
Long Answer:
I'm experiencing a similar issue. The XAML designer window uses a lot of RAM, and that happens already in the moment when the WPF project is loaded. Of course, later when testing it gets only worse, since the test consumes further memory. This could explain the 'hanging up' behaviour of the application while debugging.
If I disable the designer itself - as described by Microsoft in its performance optimiziation tips (search there for "Other tools and extensions" and "Disable XAML Designer") - it consumes much less memory (4 GB less in my case). Testing the app even without the designer will still consume a lot of memory later on, but the application might not hang up any more while debugging. Turning off diagnostics might also help a bit.
The option in VS 2022 should be in: Tools > Options > XAML Designer > Enable XAML Designer. After that, you need to restart MS Visual Studio. Albeit you have no designer then, you still will be able to edit the raw XAML file, which might be enough for smaller changes.
Upvotes: 0
Reputation: 31696
These things to attempt or keep in mind.
Repair
.DesignerProperties.GetIsInDesignMode(this)
be used to circumvent code which shouldn't be run in design time? Check constructors for such places to put that check.Upvotes: 0