title: Correct reference to VS120COMNTOOLS is lost when refreshing EntityFramework 6 .1 model from database
body: <p>I have tried previous solution of manually setting the variable VS120COMNTOOLS to correct location using Visual Studio 2013 command prompt. I then started the VS using 'devenv' command.</p>
  
  <p>When Visual Studio opens and try to build my project, I don't get the original error stating the required EntityFramework DLL is not found. Instead I get errors in DBModel.cs and Model.context.cs. In each file there is one line 'ErrorGeneratingOutput'</p>
  
  <p>I am locked in a loop as follows.</p>
  
  <ol>
  <li>I update model from database (refresh or adding a new table)</li>
  <li>The build does not work giving the following error.</li>
  </ol>
  
  <p>The host threw an exception while trying to resolve the assembly reference </p>
  
  <pre><code>'%VS120COMNTOOLS%..\IDE\EntityFramework.dll'. The transformation will not be run. The following Exception was thrown:
  System.ArgumentException: Illegal characters in path.
     at System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional)
     at System.IO.Path.IsPathRooted(String path)
     at Microsoft.VisualStudio.TextTemplating.VSHost.TextTemplatingService.ResolveAssemblyReference(String assemblyReference)
     at Microsoft.VisualStudio.TextTemplating.Engine.ResolveAssemblyReferences(ITextTemplatingEngineHost host, TemplateProcessingSession session) C:\tmp\PatternSpyGUI\PatternSpyGUI\Model.tt 0   0   PatternSpyGUI
  </code></pre>
  
  <ol>
  <li><p>I quit VS and using the command prompt set VS120COMNTOOLS correctly and start VS.</p></li>
  <li><p>Now when I try to build, I get the above stated errors in DBModel.cs and Model.context.cs.</p></li>
  </ol>
  
  <p>How can I get out of this situation? </p>