Debug NCache Providers in Visual Studio
In case you wish to debug the providers for NCache like
WriteBehind, you can do so by attaching the NCache Service to the application. This enables run time debugging through the standard debugging commands.
The provider must be built in Debug mode. Debugging will not be enabled for projects built in Release configuration.
Insert a breakpoint in your application from where you want to debug.
From the menu bar click on Debug and select Attach to Process... option as shown below.
Make sure that options Show processes from all users and Show processes in all sessions are selected.
Any operation now being performed over NCache will throw a hit in the debug code, allowing in depth debugging of the feature.
For more detail on attaching processes with various configurations to debug, please refer to this Microsoft documentation.