Computers, Programming, Technology, Music, Literature

Incorrect MSDN documentation: The space after Global:: should be removed

leave a comment »

 

Code sample posted at http://msdn.microsoft.com/en-us/library/ms228766(v=vs.100).aspx would not work and would yield you an ArgumentException with an error message as below:

Error message:

System.ArgumentException

The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))

   at EnvDTE.Command.set_Bindings(Object pVar)

 

Fix:

Fix it by removing the extra space after Global::

Code in the sample above should be changed to

//Notice there is no space after Global::
bindings[0] = "Global::CTRL+SHIFT+ALT+Y"; 
bindings[1] = "Global::CTRL+SHIFT+ALT+X"; 

 

Three hours for a triviality. Nothing unusual.

Related Links:

  1. Binding Add-In Commands to Keys – http://msdn.microsoft.com/en-us/library/5x1f46hd(v=vs.100).aspx 
  2. Visual Studio Add in Error Number 80070057 – http://www.codeproject.com/Articles/463969/Visual-Studio-Add-in-Error-Numbers-Troubleshooting#80070057

Advertisements

Written by gmaran23

August 27, 2013 at 7:45 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: