<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Debugging on Matt Thornton</title>
    <link>https://matt-thornton.net/tags/debugging/</link>
    <description>Recent content in Debugging on Matt Thornton</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <lastBuildDate>Tue, 14 Jan 2014 11:50:25 +0000</lastBuildDate><atom:link href="https://matt-thornton.net/tags/debugging/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Debugging SharePoint 2010</title>
      <link>https://matt-thornton.net/tech/sharepoint/debugging-sharepoint-2010/</link>
      <pubDate>Tue, 14 Jan 2014 11:50:25 +0000</pubDate>
      
      <guid>https://matt-thornton.net/tech/sharepoint/debugging-sharepoint-2010/</guid>
      
        <description>&lt;p&gt;I&amp;rsquo;m posting this here as, despite using this all the time, I still find myself looking it up.&lt;/p&gt;
&lt;p&gt;There are a couple of things you can do, in your &lt;strong&gt;Dev&lt;/strong&gt; environment, to assist with debugging SharePoint and your custom solutions.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;CustomErrors and SafeMode&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This should only be used in a Dev environment, but you can disable the “friendly” error messages in SharePoint and replace them with full exceptions, and, if desirable, a stack trace.&lt;/p&gt;
&lt;p&gt;You can edit the web.config for your application. Note: SharePoint has various web.configs spewed about the place, and for this to work, you need to edit the one located in&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>Could not load web.config file. The given key was not present in the dictionary.</title>
      <link>https://matt-thornton.net/tech/sharepoint/could-not-load-web-config-file-the-given-key-was-not-present-in-the-dictionary/</link>
      <pubDate>Fri, 25 Mar 2011 16:10:06 +0000</pubDate>
      
      <guid>https://matt-thornton.net/tech/sharepoint/could-not-load-web-config-file-the-given-key-was-not-present-in-the-dictionary/</guid>
      
        <description>&lt;p&gt;Quick hint about debugging SharePoint projects in Visual Studio 2010. You may find a bizarre error where deploying projects/solutions is fine, but trying to debug doesn&amp;rsquo;t work. You see an error alert with the text:&lt;/p&gt;
&lt;p&gt;“Could not load the Web.config configuration file. Check the file for any malformed XML elements, and try again. The following error occurred: The given key was not present in the dictionary.”&lt;/p&gt;
&lt;p&gt;Checking the Web.config shows no malformed XML at all. One thing to check into is the configuration of alternate access mappings in Central Administration. For debugging to work, &lt;strong&gt;the Site URL property of your SharePoint project must match the URL of the Default zone for your web application&lt;/strong&gt;.&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>new SPSite - FileNotFoundException</title>
      <link>https://matt-thornton.net/tech/sharepoint/new-spsite-filenotfoundexception/</link>
      <pubDate>Wed, 02 Feb 2011 12:55:05 +0000</pubDate>
      
      <guid>https://matt-thornton.net/tech/sharepoint/new-spsite-filenotfoundexception/</guid>
      
        <description>&lt;p&gt;It seems to me that every SharePoint developer, at some point in their career, will encounter this particular error. It&amp;rsquo;s one of those infuriatingly obtuse errors that could be caused by a multitude of different issues - either individually or cumulatively. In my case, I was in the middle of developing a SharePoint timer job and I had a particular piece of code that I wasn&amp;rsquo;t too sure about, and so wanted to test very quickly, over and over again - without the rigmarole of deploying/retracting solutions, hunting through Central Admin to run the job, etc. I just wanted to run this particular section of code against the SharePoint object model and see what happened. As is a common technique for this, I started up a fresh Console Application project, pasted in my code and figured that would be enough.&lt;/p&gt;</description>
      
    </item>
    
  </channel>
</rss>