Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2012 Web Publish on Windows 8 RTM Fails Browser Launch

I'm developing an ASP.NET MVC 4 site using Visual Studio 2012 Premium on Windows 8 RTM x64. When I right click on the web application and choose Publish, Visual Studio 2012 returns the message:

"fail to open url of 'http://.../'. Exception:Class not registered"

The publish process seems to work correctly but it fails to launch the browser. This happens every time I try to Publish the site and it happens with Chrome (21.0.1180.79 m) or Firefox (14.0.1).

Furthermore, since the site isn't launching post Publish, I do it manually using Ctrl-F5. I'm able to navigate around the site normally, but if I right click on the browser's icon on the task bar to launch another browser instance, nothing happens. Once I close all browser instances, the browser task bar icon reverts to its normal behavior.

I'm not sure if these two issues are related, but the common theme here is launching a browser from Visual Studio 2012 causes unexpected side effects. The browser either fails to launch on Publish or launches with Ctrl-F5 but renders launching another instance useless using the task bar icon.

Any help is appreciated.

EDIT: I've re-installed the entire software stack (Windows 8, Office 2010, Visual Studio 2012, Windows Update, Chrome, Firefox). The above issues continue, unless I make Internet Explorer the default browser.

Thanks.

like image 825
Rudy Avatar asked Aug 19 '12 20:08

Rudy


2 Answers

I filed a Chrome bug, it was a browser registration thing. If you uninstall and reinstall from a Download and be SURE to say Yes to the UAC prompt, Chrome will register Machine Wide, rather than User. That is required to launch as Admin. (HKLM vs. HKCU)

like image 149
Scott Hanselman Avatar answered Oct 10 '22 03:10

Scott Hanselman


It appears this problem is much more widespread than the Web Publish operation. Anytime you use the ShellExecute() API (or Process.Start) to access a URL it fails when running under elevated rights (ie. Run As Administrator).

I see this in any application that uses Process.Start() or ShellExecute(). When UAC is on and I run it normally under the UAC account everything works and the browser opens. Run with "Run As Administrator" it fails. It's easy to test.

Not sure if this is a bug in the OS, or whether Microsoft deems this as a security 'feature'.

FWIW, some people have mentioned the setting IE as the default browser works, but it doesn't work for me. Basically no links work if I've elevated rights. This has actually broken quite a few administrative applications we use in the back office for administration.

like image 31
Rick Strahl Avatar answered Oct 10 '22 04:10

Rick Strahl