File.Exists using the wrong root path?
<p>In my c# class I wrote I have a photo property that returns the photo source if the image exists (nothing or default image otherwise). In my code I use:</p>

<pre><code>    public string Photo
    {
        get
        {
            string source = "~/images/recipes/" + id + ".jpg";

            if (File.Exists(source))
                return "~/images/recipes/" + id + ".jpg";
            else
                return "";
        }
    }
</code></pre>

<p>If I get the FileInfo() information for this image I see that I tries to find this image in the following directory: <em>C:\Program Files (x86)\Common Files\Microsoft Shared\DevServer\10.0\~\images\recipes</em></p>

<p>Of course the image is not located in that directory and File.Exists is returning me the wrong value. But how can I fix this?</p>
