<p>I am storing a PNG as an embedded resource in an assembly.  From within the same assembly I have some code like this:</p>

<pre><code>Bitmap image = new Bitmap(typeof(MyClass), "Resources.file.png");
</code></pre>

<p>The file, named "file.png" is stored in the "Resources" folder (within Visual Studio), and is marked as an embedded resource.</p>

<p>The code fails with an exception saying:  </p>

<blockquote>
  <p>Resource MyNamespace.Resources.file.png cannot be found in class MyNamespace.MyClass</p>
</blockquote>

<p>I have identical code (in a different assembly, loading a different resource) which works. So I know the technique is sound. My problem is I end up spending a lot of time trying to figure out what the correct path is. If I could simply query (eg. in the debugger) the assembly to find the correct path, that would save me a load of headaches.</p>

I'm guessing that your class is in a different namespace. The canonical way to solve this would be to use the resources class and a strongly typed resource:
```
```
ProjectNamespace.Properties.Resources.file
```
```
Use the IDE's resource manager to add resources.