Vadim's Weblog

Never stop learning.

Archive for November, 2008

Ask ReSharper to not to suggest to use var instead of a type name.

Posted by Vadim on November 20, 2008

If you read my blog, you know I’m using ReSharper (R#).  Each time I install R#, I need to change the default settings.

By default R# will suggest  to use ‘var’ keyword when initializer explicitly declares type.

R#_use_var

You can see the green wavy line bellow the type.  R# wants to replace the type with var keyword.  There’s nothing wrong to use new cool keyword but I personally prefer the type instead the var keyword.

R# by default also will hint to replace the type with var for implicit declaration.  If a suggestion is green wavy line, a hint is straight line that is two characters long.

R#_use_var_implicit

So incase if you are also have a strong or may be mild desire to loose these suggestion and hint, follow this instruction:

  1. In Visual Studio select ReSharper/Optoins… or press Alt-R + O. It should open ReSharper – Options window.
  2. Click on Inspection Severity in Code Inspection section.
  3. On the right part of the dialog scroll down until you see Use ‘var’ keyword when initializer explicitly declares type.
  4. Click on arrow down button, and change from Show as suggestion to Do not show.
  5. On the next line bellow for Use ‘var’ keyword when possible change from Show as hint to Do not show.

R#_option_var

kick it on DotNetKicks.com

Posted in ReSharper | Tagged: , | 5 Comments »

Copy & Paste is broken in Visual Studio 2010 CTP

Posted by Vadim on November 9, 2008

I was astonished when I realized that copying & pasting a line in VS 2010 doesn’t works the same as in previous versions of Visual Studio.  I wasC_Key blogging more than a year ago about wonderful feature how to copy and paste in Visual Studio.

In previous versions you can copy a line by moving cursor anywhere on a line you want to copy and without selecting anything press Ctrl-C.  Then you can paste that  line anywhere by pressing Ctrl-V.  The line will be inserted above the line where the cursor is without breaking that line.

However, in VS 2010 CTP the same technique will not work despite that option to turn this feature on/off exists in Options dialog.  Just open this dialog by selecting Tools/Options and then select Text Editor/All Languages.  ‘Apply Cut or Copy commands to blank lines when there is no selection’ check box should be checked by default.

2010_Option_Copy_Paste

Actually in previous VS version I notice the same broken behavior with XAML files.

I really hope that Microsoft will make copy & paste work as before.  I’m so used to move line up or down with Ctrl-C and Ctrl-V keys.

kick it on DotNetKicks.com

Posted in Tips And Tricks, VS2010 CTP, Visual Studio | Tagged: , | Leave a Comment »

Problem installing VS 2010 & .NET 4.0 CTP

Posted by Vadim on November 9, 2008

I thought it’s time for me to follow everyone and install Visual Studio 2010.  Microsoft provides us with Virtual PC image that includes Visual Studio 2010 and .NET Framework 4.0.  So I downloaded all 11 parts, each of them is 700 MB except the last 11th part which is 286 MB.

I’m at the next point to extract the virtual machine image.  I eagerly click on Accept button at the EULA screen.  Few minutes later I see the following error when it gets to part 2:

“Write error in the file VisualStudio2010CTP.vhd. Probably the disk is full”

VS2010CTP_error

After making sure that I have enough disk space, I Google.  I was very disappointed that this time so reliable Google fail me.

I was able to figure out the problem few minutes later.  The Virtual Machine hard drive image is 23Gb.  I tried to extract it to my external hard drive  that was formatted as FAT32.  The biggest file on FAT32 file system you can have is 4Gb.

So if you encounter the same error just extract the image to hard drive with NTFS file system.

Posted in CTP, Visual Studio | Leave a Comment »