title: Metadata file .dll cannot be found CSC error
body: <p>I am getting CSC errors when trying to build my project. I have reference numerous threads here including this one on <a href="https://stackoverflow.com/questions/1421862/metadata-file-dll-could-not-be-found" title="metadata dll could not be found">metadata error dll not found</a>. </p>
  
  <p>I have checked build dependencies, unchecked and re-checked projects under Configuration Manager, checked environment variables for %VS120COMNTOOLS%, confirmed Path and C:\Windows\system32... I'm still getting a CSC error. </p>
  
  <p>The error says that "Metadata file 'C:\Users\Username\Source\Workspaces\CompanyName\Main\CompanyDataModel\bin\Debug\CompanyDataModel.dll could not be found".</p>
  
  <p>I've also looked and seen that I have a similar script as mentioned in <a href="https://stackoverflow.com/questions/3461275/vs2010-command-prompt-gives-error-cannot-determine-the-location-of-the-vs-comm">this thread</a> in my .bat files. For example, the VCVarsQueryRegistry file has for loops like this: </p>
  
  <pre><code>@for /F "tokens=1,2*" %%i in ('reg query "%1\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v8.1" /v "InstallationFolder"') DO (
  @if "%%i"=="InstallationFolder" (
      @SET "WindowsSdkDir=%%k"
  )
  </code></pre>
  
  <p>)</p>
  
  <p>Are these variables the problem? I tried to edit these for loops but right clicking and then Run as Administrator only brings up a blank command prompt and then it disappears. If I try to edit in Notepad, I get "Access denied" when I go to save the file. </p>
  
  <p>What is causing these CSC errors? </p>