DISQUS

SharePoint Magazine: Getting started with SharePoint programming: Simplifying SharePoint debugging by creating the troubleshooting toolbox

  • Bjørn Furuknap · 9 months ago
    Great tips, Ayman!

    I would also like to point out that when attaching to the debugger you can select all the w3wp processes in case your code runs in different application pools or you don't know which pool is correct.
    .b
  • mechatronix · 9 months ago
    Thanks Bjorn, I'm a fan of your articles .. extremely helpful .. waiting for your book :)
  • Randy Williams · 8 months ago
    Well written Ayman. I've read scattered references to these areas in different places, but yours is the best consolidated description of what can really help what's otherwise a frustrating experience for SP developers.
  • mechatronix · 8 months ago
    Thanks Randy, you made my day :)
  • GuyO · 4 months ago
    Regarding the logging to the System Event Log... The only reason that you would need to run this particular call with elevated privileges would be if the source specified for the error logging did not previously exist in the registry. Sources for the system event logs are located in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog. Directly under event log, you can see the of the event logs that appear under Windows logs and Application and Services Logs ( Setup and Forwarded Events being two exceptions). Each log has associated with it a number of event sources with a default source begin created for each log. The Application event log will always have an event source, etc., etc. The problem comes in when a new event source is specified (e.g., webpartName). The IIS worker process does not have permissions to create an entry in the directory.
    The solution is not to elevate the permission of the IIS worker process but to create or reuse an existing System Event Log sources. There is a little know utility called the Message Compiler that will create a resource DLL containing events and messages that can be specified when an event source is created. There is also a managed code counterpart to registering an event source with an application manifest but I have not yet taken the time to track down the particulars.