API help in Visual Studio?

Anybody know how to get the help of the Unity API in the Visual Studio IDE? Thanks.

I realize this is an old question, but wanted to add some additional information for those that might benefit.

If you want a simpler shortcut or even to make it the same as in MonoDevelop, you can do the following…

  1. Open Visual Studio
  2. Go to: Debug > Options and Settings > Environment > Keyboard
  3. Find command “Help.UnityAPIReference”
  4. Assign a new shortcut.
    For example: CTRL+ALT+’
    In MonoDevelop, the shortcuts are CTRL+’ (Windows) or CMD+’ (Mac)

Adding a Button to The Toolbar: With the tighter integration with Visual Studio mentioned in the Unity 5.2 release notes, it’s fairly simple to add a button to the toolbar instead of using the shortcut keys. This may be possible in other versions, but I only decided to do this recently…

  1. Go to menu: View > Toolbars > Customize
  2. Click New
  3. Enter a name such as “API Reference”
  4. Click OK
  5. Go to Commands tab
  6. Select Toolbar
  7. Choose the new toolbar name in the dropdown
  8. Click Add Command
  9. Select the Help category
  10. Choose cmdIdUnityDocumentation
  11. Click OK
  12. There should now be a Unity API Reference button on the toolbar

Please see RedElijah’s comment if you would also like to change the API Reference to open in an external browser instead of inside a Visual Studio tab.

Searching Offline Docs:
By request, the below instructions provide a way to more easily search offline documentation. This uses external tools. Other options would be to build an add-in for Visual Studio (or MonoDevelop) or ask Unity to update the existing add-in.

  1. Open Visual Studio
  2. Go to the menu: Tools > External Tools
  3. Click the Add button
  4. Make note of how many external tools there are now (it will be needed later).
  5. Enter a Title:
    Unity API Offline Search
  6. Enter path to your desired browser as Command:
    C:\Program Files (x86)\Mozilla Firefox\firefox.exe
  7. Enter the URL below as Arguments:
    "file:///C:/Program Files/Unity/Editor/Data/Documentation/en/ScriptReference/30_search.html?q=$(CurText)”
  8. Leave empty: Initial Directory
  9. Leave unchecked: Prompt for arguments
  10. Click OK to save changes.

Replace “#” in the below two items with the number of external tools noted earlier.

  • To add to toolbar as a button… follow steps earlier above on how to add the API reference button, but instead of the command “cmdIdUnityDocumentation” choose "External Command #” under the Tools category.
  • To add a keyboard shortcut… go to Tools > Options > Environment: Keyboard and look for the command "Tools.ExternalCommand#”.

How To Use It?
Select the text you want to search then run the external tool with preferred method (toolbar button, shortcut key, or menu option).
Warning: The external tool runs as a command line argument. Avoid selecting quotes in search text as it will cause undesired behavior.

How To Setup In MonoDevelop?
It is in a slightly different menu location (mentioned below), but very similar to Visual Studio setup. I was unable to bind a key or create a button so you will need to run it from the menu option created.

  • Go to the menu: Tools > Options > Environment: External Tools

In Visual Studio, ctrl+alt+m and then ctrl+h works for me.

I’m not totally sure what you mean by “get the help of the Unity API”, so I’m going to take a best guess here. :wink: Do you mean how to get Intellisense (Autocompletion) to expose the variables, properties, classes and methods available when you include the Unity namespaces? (UnityEngine, UnityEditor, etc)

If so, then the answer is that you need to set up Visual Studio as the IDE for Unity. You do this in Edit->Preferences->General tab->External Script Editor.

Make sure that’s set to Visual Studio. Unity will now open up scripts in Visual Studio when you click on the “Edit…”-button in the inspector, and the instance of Visual Studio that opens will have references to Unity’s assemblies, which is what enables the intellisense.

No, Christian.
I use Visual Studio to edit my Unity C# scripts. And I often need to look the definition of the API used in my source code from the editor of Visual Studio without switching to the web browser. Visual Studio offers the convenient functionality to look the Windows API definitions in MSDN from the editor of Visual Studio by press F1 key.

IDE Documentation

There is a iniline document at the unity wiki for MonoDevelop & Visual Studio
But it seems support to unity 2.6

This worked for me : mark keyword in VS e.g. Input, press ‘Ctrl+Alt+M’ at the bottom of VS the message ‘Waiting for second key of chord.’ shows up, than press ‘Ctrl+H’ , the unity help window is loaded within VS.

For 2017 community is there a known bug with this ?

My VS has this behavior:

  1. ctrl+alt+m shows noting – I tried change to another key and still nothing
  2. ctrl+shift+m shows a popup window but no matter what i choose and hit OK, nothing happens
    Here is the popup: http://myprintscreen.com/s/vu65/9966f1b597

Go to EDIT menu>>Preferences>>External Tools>>External Tools Editor>>choose Visual studio from drop down menu
If you want to assign your preferred key go to Debug menu>>Options>>Enviroment>>Keyboard>>Help.Unity.APIReference>>Press shortcut key>>Assign

If you want to open API Documents in external browser choose Tools for Unity under Options and set True to Use external browser under documentation. Hope it helps;)