Easy solution to handle Visual Studio – Out of memory issue with XAML files

Published on : Dec 12, 2011

Category : General



BizTalk360 has grown into a considerable size project, we got over 50 project in a single solution. Number of projects is not a big issue, but some of the XAML files are resource intensive and we know for sure as soon as we start working on certain areas, Visual Studio will work only for 15-20 mins before throwing the out of memory issue and we need to restart it. Even if you got a 64 bit machine, with plenty of RAM you’ll still encounter this issue, because Visual Studio is still 32 bit application. There are few articles around which discusses this problem and also a famous hack solution here. We don’t want to screw up our development environment, last thing we want is rebuilding a PC with very little spare time we got. So we hesitated to do anything that will make the environment unstable. This is the approach we follow, very simple but very effective The out of memory issue happens because of the XAML designer, it tries to render each and every change you make in the XAML (ex: changing the width of the grid, or type text for TextBlock etc, etc). In our case the XAML designer is not adding much value, since the data is not available and most of the controls are going to be blank and won’t represent the real UI state. So the fix is, don’t use XAML editor/Designer. Right-click the XAML file, select “Open with”, and choose XML Editor. Also, select “Set Default”. That’s it. You’ll have much better development experience, especially if your project is large.