1. Complete your first run at your custom claim provider project and corresponding event receiver for registration, then compile it. You want to look at the compiled assembly and get the strong name for the assembly as well as the class name for the event receiver.
2. Add a new project to your solution, and base it on a SharePoint 2010 “Empty SharePoint Project” template. Configure the project to be deployed as a farm solution.
3. Right click on the Features node in the project and select Add Feature. Your feature should be scoped to Farm and should auto activate. Otherwise, configure the feature properties as appropriate for what you are trying to do. Here is the important point – configure these two properties on the feature (in the Visual Studio Properties window) as described:
a. Receiver Assembly: put in the strong name to your assembly described in step #1, for example MyClaimProvider.ClaimTest, Version=126.96.36.199, Culture=neutral, PublicKeyToken=edb00fee02fa0701
b. Receiver Class: put in the name of the class that you wrote your custom claims provider in step #1, for example MyClaimProvider.ClaimTest.MyClaimsFeatureReceiver
4. Add your compiled custom claims provider assembly to the list of assemblies your packaging solution is going to deploy. To do this, double-click on the Package.package node in the Visual Studio packaging project. Click on the Advanced tab. Click on the Add button, then the Add Existing Assembly menu. Find the correct location for your compiled custom claims provider assembly, and leave the Deployment Target: GlobalAssemblyCache selected (it is by default). Click the OK button to save your changes and then you can close the Package properties window. One thing to note here – I usually just create a folder in my packaging project where I copy my compiled assemblies from other projects that I want to be distributed with the solution. When I configure the additional assemblies in the Package, I just select from the folder in my packaging project. In my other projects, I have a post-build script that automatically copies the compiled assembly into this assembly folder in my packaging project. It’s a simple one line of code post-build that copies the assembly whether it’s a debug or release build so I don’t need to remember to do it myself each time. It looks like this: