/// <summary>
        /// Configures the application to connect with Visual Studio using
        /// Browser Link.
        /// </summary>
        /// <param name="app"></param>
        /// <returns></returns>
        public static IApplicationBuilder UseBrowserLink(this IApplicationBuilder app)
        {
            try
            {
                if (!IsMicrosoftRuntime)
                {
                    return(app);
                }

                RegisteredBrowserLinkModule preferredRuntime = RegistryUtil.FindPreferredBrowserLinkModule();

                if (preferredRuntime != null)
                {
                    return(preferredRuntime.InvokeUseBrowserLink(app));
                }
            }
            catch
            {
                // Bug 1192984: Browser Link couldn't be loaded for some reason, so it
                // will be disabled. Let the app continue working.
            }

            return(app);
        }