Because everything related to your provisioning is done in your code, it is very useful to follow step by step what’s going on in your code.
This is how its done:
First of all make sure your provisioning Code is not running in a separate process :
Same goes for you export and import rule extensions of course.
Then go to your visual Studio project configuration manager and make sure you are compiling you code in debug Mode:
To start your debugging attach your code to the MIIServer process.
and select a location in your code where you want to set your breakpoint, I like to start at the beginning but you can break at a any location if you are looking for something specific:
now go back to your synchronization service console and select a user you want to test the synchronization process on:
basically a user you just imported
select preview and generate a preview:
And if you did everything right your debugging process will start and visual studio will stop at the breakpoint you specified and you will be able to cycle through your code seeing exactly what happens at every line:
If after you click on generate preview the debug does not work check the following:
Hope this helps