title: C# - Loading image from different assembly
body: <p>I have an image in different assembly:</p>
  
  <ul>
  <li>(.NET Standard 1.4) ResourcesAssembly/Common/Images/CompanyLogo.png <strong>- mandatory requirement</strong></li>
  <li>Build Action: Content <strong>- mandatory requirement</strong></li>
  <li>Copy to output directory: Copy if newer (I checked after a compilation - the required image is presented in output directory where my exe is located - for example, Debug/Common/Images/CompanyLogo.png. So there should be no problem to get it from there.)</li>
  </ul>
  
  <p>I want to paste it in my app's assembly (WPF) inside a window. I try 2 variants.</p>
  
  <p>1.</p>
  
  <pre><code>&lt;Image Source="pack://siteoforigin:,,,/Common/Images/CompanyLogo.png" /&gt;
  </code></pre>
  
  <p>Image in interface is visible at runtime. But VS's XAML designer doesn't show the image at design time and says it is an error:</p>
  
  <blockquote>
    <p>Could not find a part of the path 'C:\Program Files (x86)\Microsoft
    Visual
    Studio\2017\Community\Common7\IDE\Common\Images\CompanyLogo.png'.</p>
  </blockquote>
  
  <p>2.</p>
  
  <pre><code>&lt;Image Source="pack://application:,,,/ResourcesAssembly;component/Common/Images/CompanyLogo.png" /&gt;
  </code></pre>
  
  <p>Image is not visible at runtime, but at design time all are OK.</p>
  
  <p>Visual studio 2017 Community Edition 15.4.4.</p>
  
  <p>So the first variant seems suitable for me, but that strange error - why it tries to find the image in Visual Studio folder? "siteoforigin" option relates to the application exe, not to the Visual Studio exe, isn't it?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>Tried the second variant with build action as "Embedded resource" (ResourcesAssembly is a .NET Standard 1.4 project). Even cleaned and rebuilt the solution. Result is the same as in the second variant: image is not visible at runtime, but at design time it is visible.</p>