by Joakim

Error when clicking a hyperlink in Outlook (Win8/Chrome)

I switched to Windows 8 on my computer as soon as it was available as an RTM version on MSDN, and so far I’m really happy with Microsoft’s latest OS offering. I have however run into a few problems related to using Chrome as my default browser (e.g. the problem I had with external links in Visual Studio 2012).

The problem for today is the error message I got when clicking hyperlinks in emails using Outlook. Instead of the hyperlink launching a website in my default web browser (Chrome) I would get an error message saying;
This operation has been cancelled due to restrictions in effect on this computer. Please contact your system administrator.”

outlook-link-error

The cause of this problem lay in the registry. It turns out that Chrome modifies some values in the registry that it (probably) shouldn’t, namely ComputerHKEY_CLASSES_ROOT .htm and ComputerHKEY_CLASSES_ROOT .html

outlook-link-error2

Chrome had changed the (Default) value of both these entries from htmlfile to ChromeHTML….  Changing the value back to htmlfile fixed the problem. Clicking hyperlinks in emails now opens up the web address in my default browser (namely Chrome) just as expected. No annoying error message.

It looks like you could run into this problem under other circumstances than mine (Win8/Chrome as default browser), as Microsoft has written a support article about it which can be found here. The support article lists several methods to fix the problem, depending on what the root cause for the error is.

by Andreas

Visual Studio 2012 – always run as Administrator in Windows 8

In Windows 7 it was easy to turn on “Always run as administrator” for pinned Visual Studio solutions (right clicking the icon and re-open a previous solution in Administrator mode).

In Windows 8 this has changed, and even though you turn on Administrator mode for an application you’re still not able to completely turn off UAC. The result is that if you open a Visual Studio solution directly from a pinned element, you’ll be asked to restart under different credentials when you attempt to debug:

image

 

To force every instance of Visual Studio 2012 to run under Administrator credentials, locate the devenv.exe file under

C:Program Files (x86)Microsoft Visual Studio 11.0Common7IDE

Right click the file, choose “Troubleshoot compatibility” and select “Troubleshoot program” from the dialog box. In the next dialog ensure “The program requires additional permissions” is checked and click Next.

image

As soon as this is done (you’re forced to “Test program” once before you can complete the wizard) you’ll see that opening solutions by right-clicking the VS icon will now run in administrator mode.

by Joakim

External links in Visual Studio not working – Solution

In a previous post I described a problem I’ve been having with external links in Visual Studio not working under Windows 8. The problem only occurred when I started Visual Studio with administrator privileges and had Chrome set as my default browser.

It turned out that this problem was related to the way Chrome registers itself in Windows 8 during install. It also affects launching Chrome from any application run as an administrator (not only Visual Studio). The issue (and an more in-depth description of the problem) can be found here.

In short this problem is fixed if you perform a machine-wide install of Chrome (instead of installing for the current user only). This will be the default in future versions of Chrome on Windows 8, and is already implemented in the development version of Chrome. In order to fix this problem on your own machine today, uninstall Chrome, and re-install it from the dev channel (http://www.chromium.org/getting-involved/dev-channel).

by Joakim

External links in Visual Studio 2012 not working when running as administrator (Windows 8)

UPDATED 2: I did manage to find a solution for this problem, which is explained in this post.

UPDATED: I have found that this problem only occurs if you have set some other browser than IE to be the default program for the HTTP and HTTPS protocols (Chrome in my case, haven’t tested with Firefox, Opera, etc.). So, if IE is your default browser in Windows 8, or you’re running Visual Studio 2012 without elevated privileges, you won’t experience this problem.

If you have configured your web application project to use IIS, you have to run Visual Studio as administrator in order for Visual Studio to be able to access the IIS metabase (you won’t be able to load the project otherwise). The same is true if you just want to attach the Visual Studio debugger to website running in IIS without having configured the project to use IIS specifically (this way you will be able to load the project in Visual Studio without administrator privileges though).

I often do set up my web application project to use IIS, or at least I run the website in IIS and attach the debugger to the IIS process, and thus I usually run Visual Studio with administrator privileges. However while doing this, I have discovered a quirk (bug) in Visual Studio 2012 (I don’t think i was this way in 2010, but since I no longer have VS2010 installed I can’t verify it right now). When you run Visual Studio 2012 as  administrator, clicking on external links like the “More Information”-link on a Visual Studio extension, or the “Project Information”-link on a NuGet package doesn’t do anything (you don’t even get a warning or error message).

VS2012_ExternalLinks_1

VS2012_ExternalLinks_2

Clicking on the links depicted above should open your default browser and allow you to read about the extension/package.

The workaround is of course to run Visual Studio as a normal user, but it is quite annoying, especially with regards to NuGet package info if you have set up your web application project to use IIS.

This also affects extension updates, if the update button is supposed to download an external package (i.e. the update doesn’t happen inside Visual Studio).

I couldn’t find any info about this problem having been reported to Microsoft, so I also reported it as a bug.

by Joakim

Storing file history on a local drive in Windows 8

In Windows 8, the “Backup and Restore”-function that you know from Windows Vista/7 have been replaced by a new “File History”-function (which I guess it will share with Windows Server 2012, thus replacing the “Previous Version”-function in older versions of Windows Server).

File History is not enabled by default in Windows 8, you have to go to “Control Panel –> File History” and set it up. By default is doesn’t allow you to store your file history backup on a local drive (or at least not a drive which contains any of the libraries that will be backed up by default, i.e. Documents, Music, Pictures and Videos, it does not help to partition the drive).

I guess this makes sense, because if the drive breaks down, both you original files and your backup would be gone. However, I already backup up all documents etc. to my SkyDrive, I just want the ability to go back and look at previous versions of a file in case I delete one by accident or something similar. Should my hard drive break down, I’m fine with only being able to recover the latest version of my files, i.e. whatever is stored on my SkyDrive.

So, how do you get File History running against your local drive? Trick it by creating a shared folder.

win8fh_2

I created a folder on one of my drives called “FileHistory”, and shared it as “FileHistory$” (note the $ at the end of the share name, making this a hidden share). Give your own user full control to this share (this because the file history service runs as the local user account, which also means that every user need to configure file history individually for machines with multiple user accounts).

When configuring file history add your newly created network share under “Select drive”.

win8fh_1

As I already mentioned, file history backs up all your libraries (Documents, Music, Pictures and Videos) by default, in addition to folders like Contacts, Favorites, etc. (i.e. pretty much all folders located under your user folder). Note that you can exclude specific folders from being backed up if you want to. In order to include a folder in file history, you must add it to a library.

Since we’re now storing our file history on a local disk, you may also want to go into “Advanced settings” and set the size of the offline cache to as little as possible (can’t set it to 0% unfortunately). Her you can also specify how often you want files to be backed up and for how long you want to keep old versions of files.

In order to restore an old version of a file, you either open up “File History” from the control panel and select “Restore personal file”, or you just navigate to the folder in “Windows Explorer” and select “History” (doing the latter on a folder not currently being backed up will give you the option to include the folder in a library so that it will be backed up in the future).

win8fh_3

by Stian

Free e-book: Programming Windows 8 Apps

Now hat Windows 8 Release Preview is out, Microsoft wishes to celebrate this by giving away a free e-book to get started developing apps for Windows 8.

You can download the PDF version here (4.34 MB)programming_win_8_apps
Examples from the book can be download here (27.5 MB)

Content:

Chapter 1 The Life Story of a Metro Style App: Platform Characteristics of Windows 8
Chapter 2 Quickstart
Chapter 3 App Anatomy and Page Navigation
Chapter 4 Controls, Control Styling, and Basic Data Binding
Chapter 5 Collections and Collection Controls
Chapter 6 Layout
Chapter 7 Metro Style Commanding UI
Chapter 8 State, Settings, Files, and Documents
Chapter 9 Input and Sensors
Chapter 10 Media
Chapter 11 Purposeful Animations
Chapter 12 Contracts
Chapter 13 Tiles, Notifications, the Lock Screen, and Background Tasks
Chapter 14 Networking
Chapter 15 Devices and Printing
Chapter 16 Extensions
Chapter 17 Apps for Everyone: Localization, Accessibility, and the Windows Store
Chapter 18 Services