title: NancyFx will not display images
body: <p>My last attempt: Don't even know what I'm doing anymore:</p>
  
  <pre><code>Get["/{any}/x.png"] = x =&gt; {
      return Response.AsImage(Program.portal.ourRoot + "x.png");
  };
  
  Get["/{any}/{moreany}/x.png"] = x =&gt; {
      return Response.AsImage(Program.portal.ourRoot + "x.png");
  };
  
  Get["/{any}/{moreany}/{extraany}/x.png"] = x =&gt; {
      return Response.AsImage(Program.portal.ourRoot + "x.png");
  };
  </code></pre>
  
  <p>What I currently have in my ConfigureConvetions (in the BootStrapper).  I've tried a lot of permutations so far.</p>
  
  <pre><code>protected override void ConfigureConventions(NancyConventions conventions) {
      //conventions.StaticContentsConventions.AddFile("x.png", ourRoot + "x.png");
      conventions.StaticContentsConventions.Add(StaticContentConventionBuilder.AddFile("/portal/images/x.png", ourRoot + "x.png"));
      conventions.StaticContentsConventions.Add(StaticContentConventionBuilder.AddDirectory("images", ourRoot, new string[] { "png" }));
      conventions.StaticContentsConventions.Add(StaticContentConventionBuilder.AddDirectory("/portal/", ourRoot, new string[] { "png" }));
      conventions.StaticContentsConventions.Add(StaticContentConventionBuilder.AddDirectory("/", ourRoot, new string[] { "png" }));
      base.ConfigureConventions(conventions);
  }
  </code></pre>
  
  <p>I have a CustomRootPathProvider that points to ourRoot (string, currently holds a direct C:\somepathstuffhere\ to a content directory).</p>
  
  <p>I only need to serve a single image for my needs (at least, for now, things always tend to grow).  I'm using the directory structure as variables, so I need to be able to serve this image from a very large amount of locations.</p>
  
  <p>I have a copy of the image in my root folder, and in a directory called images (the "images" has had '/''s all over it, occasionally even through the middle).  I am currently referencing the image with "/images/x.png", but I've tried from the root, just the name, and "images/x.png".</p>
  
  <p>Thanks!  </p>
  
  <p>I will post back in the mean time if I figure it out (I'm assuming its something very simple.)</p>
  
  <p><strong>Solved: Worked Around? \ Non-Optimal</strong></p>
  
  <p>I changed my /images/x.png references to 'x.png', and then I dropped the extension reference to the following line.</p>
  
  <pre><code>conventions.StaticContentsConventions.Add(StaticContentConventionBuilder.AddDirectory("/", ourRoot));
  </code></pre>
  
  <p>Nancy started catching the 'x.png' image for the Root Page and the \Portal\ page.  And then the 2nd Get /{any}/{moreany}/x.png started catching the rest of the 'x.png' requests (\Portal\Project).</p>
  
  <p>I'm really not sure, why it started working all of a sudden.  I've just been playing the permutation game.</p>
  
  <p>The big non-optimal part, is every single directory's version of the image is treated as brand new.  If anyone can solve this one for me, that'd be nice.  If I figure out what to do to fix it myself, I will post back with my solution.</p>
  
  <p><strong>SOLVED</strong></p>
  
  <p>This solution won't interest anyone familiar with web programming.  Its more of a <em>new user pitfall</em> situation.  When I started setting up NancyFX I read the documentation fairly thoroughly (even if I didn't get it all on the first read).  When I got to the web.config part, I first checked the Solution Explorer in VS and I didn't see one.  So I just went into my project directory and <em>created one</em> (And there-in lies the problem).  The one I made never applied settings to the project.</p>
  
  <p>I figured it was a concept error, I just didn't know enough, to know where to look.\</p>
  
  <p>Thx for the community's help! Hopefully my experience helps some other 1st time user out.</p>