Create a field instance programmatically on a taxonomy vocabulary
If you look in taxonomy_entity_info() you'll see this code that defines the taxonomy_vocabulary entity type:

$return['taxonomy_vocabulary'] = array(
  'label' =&gt; t('Taxonomy vocabulary'),
  'controller class' =&gt; 'TaxonomyVocabularyController',
  'base table' =&gt; 'taxonomy_vocabulary',
  'entity keys' =&gt; array(
    'id' =&gt; 'vid',
    'label' =&gt; 'name',
  ),
  'fieldable' =&gt; FALSE,
);


The important bit to note is 'fieldable' =&gt; FALSE...that's why it's 'forbidden' to add fields to that type.

The taxonomy_term entity type is fieldable so you won't have any problem adding field instances to one of those.

If you really want to add a field to the vocabulary, you'll need to implement hook_entity_info_alter() to change the vocabulary entity to 'fieldable' =&gt; TRUE (I've done it before, it's perfectly safe):

function MYMODULE_entity_info_alter(&amp;$info) {
  $info['taxonomy_vocabulary']['fieldable'] = TRUE;
}