What does the C# compiler mean when it prints "an explicit conversion exists"?
<p>If I make an empty test class:</p>

<pre><code>public class Foo
{
}
</code></pre>

<p>And I try to compile code with this statement:</p>

<pre><code>Foo foo = "test";
</code></pre>

<p>Then I get this error as expected:</p>

<blockquote>
  <p>Cannot implicitly convert type 'string' to 'ConsoleApplication1.Foo'</p>
</blockquote>

<p>However, if I change the declaration of <code>Foo</code> from class to interface, the error changes to this (emphasis mine):</p>

<blockquote>
  <p>Cannot implicitly convert type
  'string' to 'ConsoleApplication1.Foo'.
  <strong>An explicit conversion exists</strong> (are you
  missing a cast?)</p>
</blockquote>

<p>What is this "explicit conversion" which is supposed to exist?</p>

<p><strong>update</strong>: the issue is a bit more subtle than I initially thought. To reproduce it, put this code in a new console application in Visual Studio 2008:</p>

<pre><code>namespace ConsoleApplication1
{
    class Foo
    {
    }

    interface IFoo
    {
    }


   class Program
   {
      static void Main(string[] args)
      {
         Foo b = "hello";
      }
   }
}
</code></pre>

<p>Visual studio will automatically show the correct error at this point (before you build the code). Now insert the "I" to turn "Foo" into "IFoo" and <strong>wait a few seconds without building</strong>. The "explicit conversion exists" version of the error will now appear automatically in the error output window and in the tool tip for the assignment error.</p>

<p>The erroneous error then <strong>disappears again when you explicitly hit F6 to build</strong>.</p>
