Search code examples
asp.netvisual-studioiisftpweb-publishing

Error when Publishing Web App using FTP to IIS 10 server


I have an Up and Running web Application that I would like to publish using FTP to a IIS 10 Server.

By doing a simple publish process, I'm getting this error:

System.AggregateException: One or more errors occurred. ---> System.Exception: Publish failed due to build errors. Check the error list for more details.
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Web.Publish.PublishService.VsWebProjectPublish.<>c__DisplayClass40_0.<PublishAsync>b__2()
   at System.Threading.Tasks.Task`1.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.ApplicationCapabilities.Publish.ViewModel.ProfileSelectorViewModel.<RunPublishTaskAsync>d__108.MoveNext()
---> (Inner Exception #0) System.Exception: Publish failed due to build errors. Check the error list for more details.<---

===================

I would like to get find out about this error and fix it. Actually my build is successful and with No Error. But Why I cant Publish any simple website to IIS 10 server using FTP?

Should I enable the FTP under the IIS server? but How if so?

Please anyone ideas and straight forwards answers is welcome.

Thanks


Solution

  • Today, I was having the same problem and just came over this question and noticed that it was not answered so I thought to write about how I solved this error.

    So, there could be more solutions but in my case I wasn't passing a correct path for the site, What I was passing was a complete path mentioned on the server which caused me an error mentioned above, In order to solve it, what I did was modified the complete path of the site with only the folder name where I was willing to publish the website.

    So, for example, What I was trying to pass was this path h:\root\xx\xxxx\www\site1 in site path field of the publish wizard of visual studio. Which I then replaced with only the directory name of the ftp account, I changed the full path of the site to just site1 and it started publishing the website.