title: Error the process cannot access the file because it is being used by another process while building project by CLI on .NET Core
body: <p>I got following error while running <code>dotnet build</code> command on my .NET Core project. </p>
  
  <pre><code>C:\Program Files\dotnet\sdk\2.1.2\Microsoft.Common.CurrentVersion.targets(4106,5
   ): warning MSB3026: Could not copy "obj\Debug\netcoreapp2.0\Blog-Yantra.dll" to
   "bin\Debug\netcoreapp2.0\Blog-Yantra.dll". Beginning retry 1 in 1000ms. The proc
   ess cannot access the file 'E:\learn\blog\Blog-Yantra\bin\Debug\netcoreapp2.0\Bl
   og-Yantra.dll' because it is being used by another process.  [E:\learn\blog\Blog
   -Yantra\Blog-Yantra.csproj]
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/1u3OG.png" rel="noreferrer"><img src="https://i.stack.imgur.com/1u3OG.png" alt="Screen shots of error message."></a></p>
  
  <p>And my csproj file looks like:</p>
  
  <pre><code>&lt;Project Sdk="Microsoft.NET.Sdk.Web"&gt;
  
    &lt;PropertyGroup&gt;
      &lt;TargetFramework&gt;netcoreapp2.0&lt;/TargetFramework&gt;
      &lt;TypeScriptToolsVersion&gt;2.3&lt;/TypeScriptToolsVersion&gt;
    &lt;/PropertyGroup&gt;
  
    &lt;ItemGroup&gt;
      &lt;Folder Include="wwwroot\" /&gt;
    &lt;/ItemGroup&gt;
  
    &lt;ItemGroup&gt;
      &lt;PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.3" /&gt;
      &lt;PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.0.1" /&gt;
      &lt;PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.0.1" /&gt;
    &lt;/ItemGroup&gt;
    &lt;ItemGroup&gt;
      &lt;DotNetCliToolReference Include="Microsoft.DotNet.Watcher.Tools" Version="2.0.0" /&gt;
    &lt;/ItemGroup&gt;
  &lt;/Project&gt;
  </code></pre>