Insufficient available memory to meet the expected demands of an operation…

April 22, 2010 08:54

2010-06-27 - Microsoft has released a hotfix for this issue. I'm installing now. If all goes well, this will be my last update on this issue. 

2010-06-18 - It looks like the VS team is planning to release a hotfix for this issue before VS2010 SP1 comes out. Here's the text of the post dated 6/16/2010:

Hi everyone - I'm writing to let you know that we just started the process of releasing a hotfix for this issue. There is no exact ETA yet, but I'll keep this thread updated with any new developments and post a link as soon as a patch becomes available. 

2010-05-26 - Update: Still having the problem. :-( This resource would seem to indicate that while one condition of the problem was fixed, there is another situation that can cause this problem and it won't be fixed until VS2010 RC1. Ugh. Here is the text of the response:

This is a known issue on VS 2010 RTM that we just recently fixed, so I'm resolving it as Fixed. As you noted, we did previously believe we had fixed this for RTM already, but fixing that part of the issue unfortunately uncovered another bug that could cause the same symptoms. The next version of Visual Studio should not have this problem, and we will very strongly consider this fix for VS 2010 SP1. For now, restarting VS should cause the error to stop displaying and allow cut/copy/paste to work again, though the problem will likely reappear after using VS again for some time and require another restart.

2010-05-03 - Update: Yep, looks like it was StyleCop for ReSharper causing the problem. The good news is that it's fixed, so unless you installed the earlier version you'll never see this problem. Thanks to the developers for getting this fixed so quickly.

2010-04-27 - Update: It's looking like this might be a StyleCop for ReSharper memory leak that has been fixed in their latest release. I reinstalled ReSharper and StyleCop for ReSharper and have not seen the problem re-materialize yet. Keeping fingers crossed.

2010-04-25 - Update: I realized that maybe VS2010 isn't causing the problem at all, and that maybe one of the 3rd party tools just isn't playing nice. So, I uninstalled ReSharper 5.0 (the release build) and I have not seen the problem again. I'll need to play around with it some more and see if it's really gone. But so far, so good. If it is ReSharper, I'll have to see if they're aware of the problem. I don't want to give up using their tool as its become one of my essentials.

I was running into this problem starting either with the Beta or RC version of Visual Studio 2010. I figured it would have been fixed by the time the RTM came out, but not so. The problem occurs after Visual Studio has been running for maybe a day or overnight. Upon highlighting some text and attempting a "copy" (Ctrl-C), I get this error:

 

image

You can see the memory usage of the devenv.exe instances I have opened. The highlighted instance is where I’m currently getting the error.

devenv memory usage

I don’t have a solution for this. Neither does Microsoft, apparently, since here we are on the RTM build and it’s still with us. If I do find a solution, I’ll update this post. If someone else comes along and has some ideas, feel free to comment below. Thanks.

[ Follow me on Twitter ]


Visual Studio 2010 Keyboard & Mouse Shortcuts

October 26, 2009 09:28

Building on my previous VS2008 Shortcuts post, I thought it'd be a good idea to see what Visual Studio 2010 brings to the keyboard and mouse shortcut arena.

While the basis for this list remains those shortcuts outlined in my previous post, I did verify that each of those shortcuts still works. New VS2010 shortcuts are highlighted in blue. Where appropriate, dialogs, etc. have been updated to VS2010. Last, I tried to order entries in a pseudo-alpha format. Barring that, they're logically placed together, so hopefully it makes sense and things are easy to find.

Keyboard Shortcuts

1. Alt-Shift-Enter to View Coding Window Full-screen

alt_key_small-w65 plus shift_key_small_w65 plus enter_key_small_h65   

Hitting "Alt+Shift+Enter" will make the coding window full-screen and (temporarily) drop most other windows from view. Restore to your usual window configuration by de-pressing the "Full Screen" button at top (the fact that it seems to be pushed up a little off-screen must be a VS2010 Beta 2 deal):

image

 

2. Alt-F12 to Find Symbol

alt_key_small-w65plusf12_key_small_h65

Use "Alt-F12" to find symbols, objects, or members.

image

 

3. Ctrl-F to do a Quick Find

ctrl_key_small_h65 plusletter_f_small_h65

Search for something in the current code file quickly with "Ctrl-f". image

 

4. Ctrl-Shift-F to Find in Files

ctrl_key_small_h65plusshift_key_small_h65 plusletter_f_small_h65

Find in files is easy with "Ctrl-Shift-f". image

 

5. Ctrl-K-C to Comment/Uncomment Code

ctrl_key_small_h65plus letter_f_small_h65 plus letter_c_small_h65

You can comment or uncomment code by highlighting the respective code block and hitting "Ctrl-k-c" to comment or "Ctrl-k-u" to uncomment. This shortcut even works in .aspx pages.

image

image

 

6. Ctrl-K-D to Reformat the Entire Document

ctrl_key_small_h65plus letter_k_small_h65 plus letter_d_small_h65

If you want to reformat all of the code in the current document, hit "Ctrl-k-d".

 

7. Ctrl-K-F to Reformat a Block of Code

ctrl_key_small_h65plus letter_k_small_h65plus letter_f_small_h65

If you've just pasted in a bunch of code where the formatting is screwed-up, just highlight it and hit "Ctrl-k-f" to format.

 

8. Ctrl-K-L to Toggle Outlining Ctrl-M-M to Toggle Outlining

ctrl_key_small_h65plus letter_m_small_h65 plus   letter_m_small_h65

If you want to open (expand) or close (collapse) all outlining in a code file, use "Ctrl-m-m". It works like a toggle, alternatively expanding or collapsing all outlining in the current file.

 

9. Ctrl-K-S to Access Code Snippets

ctrl_key_small_h65plusletter_k_small_h65plusletter_s_small_h65   

Easily open the code snippets selection dropdown with "Ctrl-k-s":

image

 

10. Ctrl–K–T to View Call Hierarchy

ctrl_key_small_h65plusletter_k_small_h65plusletter_t_small_h65

Highlight a member operation and hit "Ctrl-k-t" to view it's call hierarchy.

image

A new window will open:

image

 

11. Ctrl-L to Cut Line to Clipboard

ctrl_key_small_h65plus letter_l_small_h65

It's not necessary to highlight an entire line and then hit the delete key. Just hit "Ctrl-L" and the line the cursor is currently on will be removed and copied to the clipboard. "Ctrl-x" performs the same operation by default.

 

12. Ctrl-F3 to Search Without the Dialog

ctrl_key_small_h65plus f3_key_small_h65

ctrl_key_small_h65 plus shift_key_small_h65plus f3_key_small_h65 

Just highlight the text you want to search on and hit "Ctrl-F3" to search down or "Ctrl-Shift-F3" to search up.

 

13. Ctrl-, (Ctrl-Comma) to Perform a Fuzzy 'Navigate To' Search

ctrl_key_small_h65plusimage

Perform a "fuzzy" search and get location information with "Ctrl-," (Ctrl-Comma).

image

 

14. Ctrl-] to Find Matching Curly Brace or Region

ctrl_key_small_h65plus right_curly_brace_paren_small_h65

Position the cursor next to a curly brace ('{' or '}') and hit "Ctrl-}'. This will toggle the cursor between the matching braces.

image

This shortcut will also work for #region...#endregion's.

 

15. F9 to Add/Remove Breakpoint

f9_key_small_h65

'F9' will toggle breakpoints for the current line.

 

 

16. F12 to Go to Definition

f12_key_small_h65

Put the cursor on an item and hit 'F12'. Instant 'go to definition' functionality.

 

17. Shift-F5 to Stop Debugging

shift_key_small_h65plus f5_key_small_h65

To stop debugging a project, use "Shift-F5". Much quicker than going through the Debug menu.

 

18. Shift-F12 to Find Usages

shift_key_small_h65plusf12_key_small_h65 

'Shift-F12' will find all usages of the item the cursor is currently on and display the "Find Usages" dialog (this is ReSharper's version of the dialog; standard VS2008 looks a little different):

image

 

 

19. 'prop' to Create New Property

propplustab_key2_small_h65 plustab_key2_small_h65

Add a new property in code by typing prop then hitting the Tab key twice. This "prop-TAB-TAB" combination will create a property template that looks like:

   1: public int MyProperty { get; set; }

 

Mouse Shortcuts

1. Right-click to add references

Say you've just entered a line of code like the following where the red squiggly indicates you haven't yet added the necessary reference (in VS2010 Beta 2, the red squiggly isn't showing up, but the shortcut still works):

image

You could jump to the top of the file and type it in manually, or you could right-click on the squiggly-indicated word and choose "Resolve | using …":

image

This will add the needed reference for you, no typing required.

 

2. Zoom In/Zoom Out

ctrl_key_small_h65plusimage

The same Word functionality of pressing Ctrl and zooming in and out is now in VS2010.

 

3. Remove unused references

Many times there are references included in the "using…" section that are not needed. Removing the unnecessary ones is easy: Right-click anywhere on the code file, select "Organize Usings | Remove Unused Usings".

image

 

4. Sort usings

To sort your "usings…" section, right-click anywhere on the code file and select "Organize Usings | Sort Usings".

image

 

5. Open a file's "containing folder"

Right-click on an open file's tab, select "Open Containing Folder".

image

 

6. Copy a file's folder location to the clipboard

Right-click on an open file's tab, select "Copy Full Path".

image

 

7. Close all files but "this" one

If you have more than one file open, you can right-click on one of the file tabs (the one which you want to stay open) and choose "Close All But This". This will close all other files.

image

 

8. Close tab

A quick way of closing a tab is to use the mouse scroll or middle button. Hover the mouse cursor over the tab, click the mouse scroll button, and the file (and it's tab) will close.

 

9. Highlight References/Usages

Place the cursor on any member and VS2010 will auto-highlight it throughout:

image

 

Conclusion

Again, if anyone has anything I missed (I know there's got to be a lot), leave a comment. I'd love to learn some new ones!

More Visual Studio Shortcuts, Tips, and Tricks

 

[ Follow me on Twitter ]