Calling a Library Function from a View (MVC C#)
<p>I have a function in my Misc library in App_Code called EncodePicture which encodes a picture.  However when I try to call the code, I get the function exists in both.  I've looked at other answer such as clearing down the temporary files, I did that but it didn't work.  The Misc Library has No namespace, does it need it?</p>

<p>I'm calling the function as :-</p>

<pre><code>&lt;img id="imgTitle" src="data:image/png;base64,@Misc.EncodePicture("/aPic/banner.jpg")" alt="" width="468" height="60" /&gt;
</code></pre>

<p>I get it Misc exists in both Universe and App_Code..... </p>

<p>How can I get round this problem?  The function is :-</p>

<pre><code>using System.Security.Cryptography;


namespace Universe
{

public class Misc
{

    public static string EncodePicture(string sFilename)
    {
        string sEncode = "";

        using (FileStream fs = new FileStream(HttpContext.Current.Server.MapPath("~" + sFilename), FileMode.Open))
        {

            System.IO.BinaryReader br = new BinaryReader(fs);
            Byte[] bytes = br.ReadBytes((Int32)fs.Length);
            sEncode = Convert.ToBase64String(bytes, 0, bytes.Length);
        }

        return sEncode;
    }
</code></pre>

<p>Please don't say hard code the value because I'm going to be using this style in other places and can't hard code all the images.  C# or VB.NET pls.</p>

<p>Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. </p>

<p>Compiler Error Message: CS0433: The type 'Misc' exists in both 'App_Code.keoe0a1i, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' and 'Universe, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'</p>