XDS
XDS

Reputation: 4188

Force Internet Explorer to advertise itself as IE11 when it's launched embedded in Visual Studio

When launching an embedded Internet Explorer inside Visual Studio 2015 it advertises itself as IE9 in terms of user-agent-string (even if it's actually IE11 under the hood). This causes problems in websites like Udemy and so on. I have followed the instructions in websites like:

http://www.cyotek.com/blog/configuring-the-emulation-mode-of-an-internet-explorer-webbrowser-control

I inserted a new REG_DWORD named 'devenv.exe' under both FEATURE_BROWSER_EMULATION keys that exist in the registry (32bit / 64bit). Said REG_DWORD has value 11001 (decimal) aka 2af9 in hex. I have also tried 11000 but no joy there either. This registry tweak works for all other apps except for Visual Studio. I failed to find any option that might help under Internet Explorer options. Any insight on what to do to resolve this issue will be highly appreciated.

Upvotes: 1

Views: 415

Answers (1)

XDS
XDS

Reputation: 4188

Good news and bad news.

  • Good news is that Visual Studio appears to be placing it's 'devenv.exe' REG_DWORD under a different location (according to these instructions):

HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION

In the above registry path 'devenv.exe' is set to 9999 by default.

  • Bad news is that even if you change the above 'devenv.exe' to 11000 Visual Studio will revert the value upon re-launch to 9999.

All things considered, the only option (at least in my mind) is to launch Visual Studio and let it and load fully, then change devenv.exe to 11000 and then launch IE inside Visual Studio in that order. With this tricky order IE gets launched as IE11 inside VS. Maybe an even better approach would be to create some sort of script to achieve the same effect somewhat easier.

Update: I created a small C# utility which you can invoke through the Windows Scheduler every 5mins after each login. The utility will run continuously for 5mins and then it will stop and restarted from the Windows Scheduler (you have to pass the command line argument '5' for this to happen). Every 10secs or so the utility will set the registry key mentioned above to 11000.

https://www.dropbox.com/s/bqsbs34gfe0j341/VisualStudioUtilityForSettingIEtoMaxVersion.zip?dl=0

If there is a better approach than this one feel free to tip me off.

Upvotes: 2

Related Questions