title: How do I programmatically add an assembly reference to a project?
body: <p>I have been trying to use Roslyn to parse a solution file and programmatically add a custom assembly reference to each project in the solution.</p>
  
  <p>I tried using the following code snippet to do the same:</p>
  
  <pre><code>//The name of the DLL is customLib.dll
  var reference = MetadataReference.CreateAssemblyReference("customLib");
  project = project.AddMetadataReference(reference);
  </code></pre>
  
  <p>However, it encounters a FileNotFoundException while creating the MetadataReference.</p>
  
  <p>So, my question is : <b>How do I specify the path at which Roslyn needs to check for the specified dll</b>?</p>
  
  <p>Thanks.</p>