Saturday, October 30, 2010

Chrome is not displaying XML

One of the reasons I don't use Chrome for development is that it renders XML in the browser instead of simply displaying it as raw XML. Originally an XML file will be displayed like this (or maybe rather, not displayed);


But now I just found a solution at StackExchange (developed and run by StackOverflow) and the XML Tree Chrome Extension is available at the Google chrome extensions web site.

Simply click the "Install" button and it gets installed:


After installation my XML renders beautifully:


Many thanks to Josh Moont.

VS2010 registry capture utility keeps crashing!

My final problem before my projects would rebuild on my new Windows 7 machine was that I kept getting this message:


The text in this dialog says:
Microsoft (R) Visual Studio registry capture utility has stopped working.
After searching the web for a while I found the solution in StackOverflow, where the answer refers to a workaround at Microsoft Connect.

Anyways, here is the workaround procedure to use to fix this problem (this is actually a Windows 7 problem?!):
  1. Locate regcap.exe here: C:\Program Files\Microsoft Visual Studio 10.0\Common7\Tools\Deployment
  2. Right click and select properties.
  3. Select Compatibility tab
  4. Check box to Run this program in compatibility mode.
  5. Select Windows Vista SP2 in the OS drop-down and Run as Administrator.
  6. Click Ok and Recompile.
This solved the problem for me and now my batch of projects build in VS2010 on my new Windows 7 machine.

VS2010 keeps cancelling the importing of my key files

When I built some of my VS2010 projects, which were strongly signed, on my new Windows 7 machine, I kept getting this error:


The text goes something like this:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1970,9): error MSB3325: Cannot import the following key file: MyStrongNameKey.pfx. The key file may be password protected. To correct this, try to import the certificate again or manually install the certificate to the Strong Name CSP with the following key container name: VS_KEY_A17E1D1A20966ADB
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1970,9): error MSB3321: Importing key file "MyStrongNameKey.pfx" was canceled.
So, to solve this I simply went into the properties of the project, selected the "Signing" tab and browsed for the pfx file:


Once found, I selected it and provided the password to the private key of the file:



Once reloaded, the project would easily rebuild.

VS2010 elevated to load local Web Apps

I just thought I would share with you a couple of things I had to go through to get Visual Studio 2010 to build a couple of my projects on a new Windows 7 machine.

1) Firstly there was the problem with getting Visual Studio elevated in order to load my Web Application projects, deployed on the local IIS. I kept getting this error...


...and the error message in the Console dialog was this:
MyWebProject.csproj : error : The Web Application Project MyWebProject is configured to use IIS. To access local IIS Web sites, you must run Visual Studio in the context of an administrator account.
Of course I could simply right-click my "Microsoft Visual Studio 2010" short-cut and select "Run as administrator" but that is not something I want to do everytime I open up VS2010 and it will not work on solution files.

My solution is to tell Windows ALWAYS to run devenv.exe in an elevated state. This we do with a right-click on the "Microsoft Visual Studio 2010" short-cut and go into properties:

In there, we enter the "Compatibility" tab and select "Change settings for all users" (if you need to) and then check "Run this program as administrator" under "Privilege level":
And that is it!

2) When that was done, there was the problem with the endless UAC dialog.


So, we abandon the UAC notifications. This is easily done using the UAC Settings dialog accessible in the Control Panel. We move the lever down to "Never notify"...


...and then we have that one sorted.