FIX: Target Audience: no exact match was found

Scenario: 
You have two SharePoint user groups with "similar" names, created in this order:
    CA news administrators
    US news administrators

You can only set the target audience to the first created group (CA news administrators in this case)
When you try to set the target audience to the second (or third and so on) group you get this message:

No exact match was found. Click the item(s) that did not resolve for more options.




Fix:
Rename the the user groups so the names are less "similar":
    Canada news administrators
    United States news administrators

I am not sure how SharePoint figures out the similarity between the group names but the above fix worked in my case.

Bug:
This is a bug in SharePoint 2010 SP1.

HowTo: Activate Target Audience

Scenario: 
You open the web part it in edit mode, and under the Advanced section, the Target Audience box is missing.

How To:
browse to Central Administration -> System Settings -> Manage Services on server.
start User Profile Service

browse to  Open Central Administration -> Application Management -> Manage Service Applications.
create create a NEW User Profile Service Application (of make sure the existing one is started)

At this point the Target Audience box should be showing for your web part.

Debugging in Visual Studio


If you don't know what process you have to attach Visual Studio to, or, although Visual Studio seems to be attaching, it does not break the execution on your breakpoint, you can add this line to your code:

 System.Diagnostics.Debugger.Launch();  

When the code execution reaches this line, Visual Studio will be opened in debug mode.

Example:
     public override void FeatureActivated(SPFeatureReceiverProperties properties) {  
       System.Diagnostics.Debugger.Launch();  
       ... more code here ....  
     }  

Note that you have to enable Just-In-time debugging in Visual Studio.