title: FileNotFoundException was unhandled - But the file is there
body: <p>I'm struggling with this. My WPF app, in debug/release works fine. After I publish it, via InstallShield Express, I get a runtime exception and the program crashes.</p>
  
  <p>When the program crashes, I can choose to debug the program in Visual Studio, it breaks in the RelayCommand which looks like</p>
  
  <pre><code>public class RelayCommand : ICommand
  {
      public Action&lt;object&gt; _execute;
  
      public RelayCommand(Action&lt;object&gt; execute)
      {
          this._execute = execute;
      }
  
      public bool CanExecute(object parameter)
      {
          return true;
      }
  
      public event EventHandler CanExecuteChanged;
  
      public void Execute(object parameter)
      {
          this._execute(parameter); // where the breakpoint is
      }
  }
  </code></pre>
  
  <p>The error message is</p>
  
  <blockquote>
    <p>FileNotFoundException was unhandled<br>
    Could not load file or assembly 'TaskScheduler, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified</p>
  </blockquote>
  
  <p>I'm lost as to why this is. I have other commands on the page, and they are all set up in the following manner</p>
  
  <pre><code>   public ICommand SaveScheduledTaskCommand { get; set; }
     public ICommand OpenFileCommand { get; set; }
  
      #region Constructor
  
      public MyApp()
      {
          OpenFileCommand = new RelayCommand(new Action&lt;object&gt;(OpenFile)));
          ScheduledTaskCommand = new RelayCommand(new Action&lt;object&gt;(SaveScheduledTask));
      }
  
      #endregion
  
      private void OpenFile(object o)
      {
          MessageBox.Show("OF"); //works fine
      }    
  
      private void SaveScheduledTask(object o)
      {
          MessageBox.Show("TS"); //never shows
          TaskScheduler ts = new TaskScheulder();
          //more code
      }    
  </code></pre>
  
  <p>I guess the issue is with the TaskScheduler.dll (based upon the error message) but, the .dll exists in the installed folder (under c:\Program Files\Compamy\MyApp)...  </p>
  
  <p>I don't think it matters but, the TaskScheduler.dll is saved outside of my project (it is saved on the desktop) but I assume this is not relevant as the installer will take a copy of it and save it to the program Files folder any way?</p>
  
  <p>I used InstallShield Express to create the installer and other than this, it works fine. I also another 3rd party dll, XCeed, and this work fine in my app.</p>
  
  <p>I'm totally lost as to what I can do as I can't see how I can fix the code! Why can't the application "see" the dll?</p>