title: Image reading at WPF application deployment environment
body: <p>I have a WPF Application project directory like this </p>
  
  <p><img src="https://i.stack.imgur.com/zQapc.png" alt="enter image description here"></p>
  
  <p>Actually i have added a Folder named "Resources" inside Visual studio project and added some images into that.Physically the folder was created at above location.We can see that at above picture.Default properties of images inside "Resource"folder are given below</p>
  
  <pre><code>BuilAction:Resource
  Copy output Directory:Do not Copy 
  </code></pre>
  
  <p>I am reading an image called "form1.ico" file from this folder like this</p>
  
  <pre><code>&lt;Window
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" x:Class="MyApp.FrmMain"
      Title="MyApp" Height="768" Width="1024" WindowStartupLocation="CenterScreen" x:Name="MainWindow" WindowStyle="None" Loaded="MainWindow_Loaded" ShowInTaskbar="False" ResizeMode="NoResize" WindowState="Maximized" mc:Ignorable="d" Icon="/MyApp;component/Resources/form1.ico" StateChanged="Window_StateChanged"&gt;
  </code></pre>
  
  <p>Every think work fine, if i run the application using Visual Studio 2008.But the Resource file is not created inside the Bin folder.My problem is if i copy the bin folder from this location to another location an run the exe which is created at bin the application get  crashed(it seems it is searching absolute path of image)this is happen also if i move the Resource folder to another location.I have Tried to set properties of Images like this</p>
  
  <pre><code>BuilAction:Content
  Copy output Directory:copy always
  </code></pre>
  
  <p>Now it is creating a Folder name "Resources" inside bin folder.But it is not even run the application via Visual studio.it throw an Exception says it cant find particular icon.</p>
  
  <ul>
  <li>Can any one explain why this is happening? </li>
  <li>How can i copy these Resource folder when deploy the application?Because i need my application read files from that folder at deployment environment.</li>
  <li>If i Set the property to embedded Resource is it possible to replace the image at
  run time with another image?</li>
  </ul>
  
  <p>Thanks in Advance:)</p>