Debugging custom User Managers
This topic describes how to debug a custom User Manager.
- Add breakpoints to your code.
- Stop the K2 service.
- Copy the project assembly and .pdb files to the K2 server as described in the Register a custom User Manager topic.
- Start the K2 service and then use Visual Studio's Debug > Attach to process option to attach to the K2HostServer.exe process on the K2 server. If debugging against a remote K2 server, you will need to enable remote debugging. See the Microsoft Remote Debugging and Diagnostics MSDN article for more information.
You may need to check the options Show Processes from all users and Show Processes in all sessions before the K2HostServer.exe process will show up. - Run the security provider by logging in as a user with the custom security provider label, or by using the User/Group context browser in a K2 design tool to explore the list of users. (See the Testing a Custom User Manager topic for ways you can test the custom user manager). Your breakpoint should be hit.
- Step through and debug your code.
Attaching to the K2 host server process and hitting a breakpoint will suspend all execution on the K2 server, so use this approach carefully in any shared K2 environment.