Monday, June 28, 2010

VS2010 patch for Cut and Copy "Insufficient Memory" issue

The Visual Studio 2010 Editor team has released a hotfix to reduce the frequency of the annoying error of VS2010 displaying the error message that there is "insufficient available memory to meet the expected demands of an operation at this time..." that can occur when trying to cut or copy text to the clipboard.

After upgrading to VS2010 a month ago this error plagued our project incessantly. The previous workaround for the team has been to use Steve Harman's documented hack for VS2008, but on the VS2010 executable (http://stevenharman.net/blog/archive/2008/04/29/hacking-visual-studio-to-use-more-than-2gigabytes-of-memory.aspx) which seemed to work.

The official Microsoft hotfix can be downloaded here https://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=29729

kick it on DotNetKicks.com Shout it

Friday, May 28, 2010

VS2010 and Resharper 5.0 performance - KB974417

On my current project we have upgraded our solution from VS2008 to VS2010. I'm a big user of Resharper 5.0 in VS2008 and have it also installed in VS2010.

However when the solution was loaded Resharper would completely lock up VS2010 and eventually crash. Disabling Resharper 5.0 didn't help much (phew! can't live without Resharper), but the problem still remained.

The VS2010 IDE became very unstable for our WPF and heavily resourced solution targeted at .Net 3.5. Visual Studio would regularly crash (say every 10 minutes) with an Out of Memory exception of some kind. If it didn't crash then the build would fail with some out of memory or not enough resources message.

Fortunately in the Event Viewer there was this particularly unhelpful message:

Event Type: Error
Event Source: .NET Runtime Optimization Service
Event Category: None
Event ID: 1103
Description:
.NET Runtime Optimization Service (clr_optimization_v2.0.50727_32) - Tried to start a service that wasn't the latest version of CLR Optimization service. Will shutdown

This error seems to relate to a failed or corrupted installation of KB974417 - which applies when .Net 4.0 framework is installed.

There are two ways to fix this. One or both may work for you.

The first is to manually install the update via the Geek Lab article.
The second is to remove the conflicting update and then reinstall:
  1. Uninstall update KB976569 manually through Add/Remove programs.
  2. Download KB974417 for your platform and install it.
  3. Re-install KB976569

If you don't have KB976569 installed to start with then it is possible to resolve this issue by installing KB976569 then following the steps above.

Problem solved! Enable Resharper and code away.

kick it on DotNetKicks.com Shout it