title: ASP.NET web application fail to publish in Visual Studio 2019
body: <p>The application which I'm working now was developed in VS 2015. I'm trying to run the same in VS 2019, the build succeeded but fails when trying to publish via FTP / to the local folder as well.</p>
  <p>A diagnostic log has been written to the following location .tmp file.</p>
  <blockquote>
  <p>System.AggregateException: One or more errors occurred.</p>
  <p>System.Exception: Build failed. Check the Output window for more details.<br />
  --- End of inner exception stack trace ---</p>
  <p>at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)<br />
  at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)<br />
  at Microsoft.WebTools.Publish.PublishService.VsWebProjectPublish.&lt;&gt;c__DisplayClass43_0.b__3()<br />
  at System.Threading.Tasks.Task`1.InnerInvoke()<br />
  at System.Threading.Tasks.Task.Execute()<br />
  --- End of stack trace from previous location where exception was thrown ---</p>
  <p>at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)<br />
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)<br />
  at Microsoft.Publish.Framework.ViewModel.ProfileSelectorViewModel.d__213.MoveNext()</p>
  <p>(Inner Exception #0) System.Exception: Build failed. Check the Output window for more details.</p>
  <p>System.Exception: Build failed. Check the Output window for more details.</p>
  </blockquote>
  <p>The following are the details in the Output window.</p>
  <pre><code>1&gt;------ Build started: Project: EmpDetails.BAL, Configuration: Release Any CPU ------
  1&gt;  EmpDetails.BAL -&gt; C:\Test\Projects\source\repos\Project\EmpDetails.BAL\bin\Release\EmpDetails.BAL.dll
  2&gt;------ Build started: Project: EmployeeDetails, Configuration: Release Any CPU ------
  2&gt;  EmployeeDetails -&gt; C:\Test\Projects\source\repos\Project\EmployeeDetails\bin\EmployeeDetails.dll
  3&gt;------ Publish started: Project: EmployeeDetails, Configuration: Release Any CPU ------
  3&gt;Connecting to C:\Test\Projects\ProjName\Published Website...
  3&gt;
  ========== Build: 2 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========
  ========== Publish: 0 succeeded, 1 failed, 0 skipped ==========
  </code></pre>
  <p>I googled the same and tried the following</p>
  <ol>
  <li>run Visual studio in administrator mode.</li>
  <li>Give read/write privileges to the destination folder.</li>
  <li>Shorter the URL path</li>
  <li>Set &quot;Build + Intellisense&quot; in Error list.</li>
  </ol>
  <p>Nothing works.</p>
  <p>But when I created the sample application in VS 2019 and I'm able to publish it.</p>
  <p>Just a thought, do I have to change/update anything in Web.config file.</p>
  <p>I'm struggling to fix this issue for past two days. How to fix it?</p>