How to change the default search in Visual Studio 2015

While I was writing my code in Visual Studio 2015CTP , I received an error, as shown below in the ErrorList window:

Error CS0117 "Console" does not contain a definition for "ReadKey"

By clicking CS0117 , it redirects me to the default browser and performs a search using Bing. Since most of the time we use Google as a search engine, is there a way to make Google as your default search instead of Bing.

+6
source share
4 answers

Just redirecting the search provider probably won't work. We create a search bar designed to work with a specialized search engine on the Bing side. Passing the same search string to another search engine is likely to give poor results.

Instead, you will need to define your own handler for the help event. This will allow you to extract the necessary information from the error itself (for example, error code, language, etc.), in order to create a general search that will work with the provider of your choice. If this handler is before the default handler, you can handle the event and prevent the default search (bing) from occurring.

Interfaces required for implementation:

ITableControlEventProcessorProvider

This is an MEF export and must have the following attributes:

 [Export(typeof(ITableControlEventProcessorProvider))] [DataSourceType(StandardTableDataSources.ErrorTableDataSourceString)] [DataSource(StandardTableDataSources.AnyDataSourceString)] [ManagerIdentifier(StandardTables.ErrorsTableString)] [Name("my custom event processor name")] [Order(Before=Priority.Default)] 

ITableControlEventProcessor

It is probably best to define a class that is derived from TableControlEventProcessorBase (which provides a default / no-op implementation for all events) and then explicitly processes the PreprocessNavigateToHelp(ITableEntryHandle entry, TableEntryEventArgs e) event:

  • extracting useful data from a record
  • Create a general search for the search provider of your choice
  • opening browser instance
  • setting e.Handled to true (to prevent other handlers from executing).
+2
source

There is no built-in support for switching the search engine used. However, you can create an extension that allows you to link Google (and other) search engines, as was done in previous versions of Visual Studio.

I would point you to documents with information on how to create such an extension, but they have not yet been published. They are on the list of documents that will be published around the time the version of Visual Studio 2015 is officially released.

+1
source

You can change it by setting the host entry to 127.0.0.1 for bingdev.cloudapp.net and using the IIS URL rewriter module to redirect your request to google.

I talked in detail about my blog

0
source

Another quick hack I just made would be the script browser. I used Greasemonkey to generally redirect requests from Bing to Google. Because who the hell ever chose the former over the last ...

If you have Greasemonkey installed or other places to use a custom name, you can use

 // @include http://www.bing.com/search?q=* var rex = /\?q=(.+)/; window.location.href = ("http://www.google.com/#safe=off&q="+window.location.href.match(rex)[1]); 

always redirect from Bing to Google.

Actually not VS answer, but workaround. And in my case, this seems fine, as I prefer Google.

0
source

Source: https://habr.com/ru/post/988383/


All Articles