title: UnRAR DLL unable to be referenced in C#
body: <p>I was trying to make a program to clean out some directories on my NAS and I noticed that a lot of folders contained nested rar and zip files and I have plenty of space to unpack them.  The program should ask the user for a directory to be cleaned then unpack all rars then delete all of the rars.  I'm trying to use UnRAR DLL and I cant even get the rars to unpack. I realize I'm having an issue where visual studio 2022 is refusing to recognize the Unrar DLL in the &quot;using&quot; command.  Because of that I've been unable to unpack a single file.  This is one my first useful programs so if im missing something basic I understand.</p>
  <p>This is my initial attempt:</p>
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  using System.IO;
  using System.Diagnostics;
  using UnRAR;
  
  
  
  namespace Cleaning
  {
  
      class Program
      {
          static void Main(string[] args)
          {
              Console.WriteLine(&quot;Enter Directory To Be Cleaned&quot;);
  
              string rar_path = Console.ReadLine();
  
              string[] Rars = Directory.GetFiles(rar_path, &quot;*.rar&quot;, SearchOption.AllDirectories);
  
  
  
              foreach (string rar in Rars)
              {
  
                  string source = rar;
                  string dest = &quot;C:\\Users\\Kaleb\\OneDrive\\Desktop\Test Area&quot;;
                  UnRAR unrar = new UnRAR();
                  unrar.Password = &quot;password_of_myarchive&quot;;
                  unrar.Open(@source, UnRAR.OpenMode.Extract);
                  while (unrar.ReadHeader())
                  {
                      unrar.ExtractToDirectory(@dest);
                  }
                  unrar.Close();
              }
              
  
              
          }
  
         
  
          
      }
  }
  </code></pre>
  <p>For reference I have added the UnRAR  DLL to the project folder.</p>