26 June 2013

Visual Studio - Disable #Region Block Generated When Implementing An Interface

One of the things I have found really annoying when coding in Visual Studio is the fact that when implementing an interface, the editor will wrap the method calls in a #region/#endregion block. So today I was determined to find out how to get rid of them.

It is actually really easy and all you have to do is :

  • Open the TOOLS menu.
  • Select Options...
  • Select the Text Editor option.
  • Select your target language (mine is C#).
  • Select the Advanced node.
  • Deselect the "Surround generated code with #region" option.
  • Click OK

Annoying problem goes away!

19 February 2013

Installing Visual Studio 2012 Update 1. Failures & a possible solution.

Having installed Visual Studio 2012 about a month ago, I finally got around to wanting to do some serious coding with it. Attempting to run my test's I found a message in the Output window that reported an exception had been thrown and that test discovery mechanism had failed. Having a quick Google about I found a lot of people reporting the issue with Visual Studio 2012 Professional if Update 1 was not installed.

So I headed into Visual Studio 2012 and downloaded the Update and fired it off expecting it to be a 10 minute install with no issues.

The first install attempt failed. It didn't give me much to go on except the install log and a link to some Microsoft Tips and Solutions page (which no longer appears to exist). So I tried to repair it. That also failed!

So I removed the update and rebooted and downloaded another copy direct from Microsoft in case there were any issues with the first .exe. I installed again, it failed again. So this time I tried to repair the Update (from the Updates own installer). It failed.

Although it failed, this time I go more information, it had failed when it got to the Visual Studio JavaScript Extensions for Windows Library. After some more serious Googling about I found a post that, on a related subject, suggested downloading the library direct from Microsoft. This I did and I run the Updates Repair option again.

It failed again! There was a serious patten forming here however, this time it complained about Web Deploy 3 already being installed. So I removed Web Deploy 3 and ran the Repair option again and it worked!

So far my overall experience of Visual Studio 2012 is not that great. I had issues installing Visual Studio 2012 in the first place (on Windows 7) and now I have wasted a couple of hours trying to install Update 1.

21 January 2013

Slow Chrome & Firefox Debugging on Windows 7.

These days I live in web browsers and all of my day to day work is browser based. Since I moved to Windows 7 I have had an issue where by Chrome and Firefox would take ages to connect to my local IIS instance. After suffering this for some time I decided to get to the bottom of it.

As it turns out (and there are a lot of false claim on Google!) it is as simple as ensuring you have localhost uncommented in your hosts file. The hosts file can be found in \Windows\System32\drivers\etc. It would appear that if you use host headers for local development work then without this uncommented you are hitting the public DNS servers from what I can tell.

I should add that I am not running IPv6 and so did not enable ::1 localhost but you should if you are running on an IPv6 enabled network.

14 January 2013

Installing Visual Studio 2012 (Windows 7)

Some things in life should be as simple but aren't! After years of installing various versions of Visual Studio you would think I would be prepared for battle but Visual Studio 2012 still managed to get me!

tl;dr Use this iso file to install Visual Studio 2012 Pro, the web installer doesn't work!

(As a side note, I long for the day where installing something on Windows is as easy as it is on *nix. I can install a whole operating system and associated programs in the time it takes to install Office! Alas, that is a separate post!)

Being a modern kind of guy I opted to try and install Visual Studio 2012 Pro via the web installer. I have a decent internet connection and was not expecting a 2 hour install. I was even more disgruntled when it failed! It apparently had not managed to install the Javascript or Sql 2012 tools packages. Reading the ever interesting log files provided no useful (translate : Google'able) info and so I tried to repair the installation. That also failed only this time with a longer list of failed packages.

I then decided I would try a clean install using the old fashioned iso provided by Microsoft. I tried to uninstall Visual Studio 2012 and .... it failed! (I can see a patten forming here.) I tried various things and finally after three tries managed to uninstall it. By try various things I mean I rebooted, I tried to kill various processes that looked like the installer was orphaning and clearing out %temp%.

I then installed this iso file (via the excellent daemon-tools). Forty minutes and another coffee later and it worked and installed.

You would think that in this day and age the web installer would be fail safe. It should know what packages you need download them and install them in a fast and successful manner. Come on Microsoft, it's not hard!