使用 FTP 将 Web 应用程序发布到 IIS 10 服务器时出错

Error when Publishing Web App using FTP to IIS 10 server

我有一个 Up 和 运行 网络应用程序,我想使用 FTP 将其发布到 IIS 10 服务器。

通过简单的发布过程,我收到了这个错误:

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.<---

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

我想找出这个错误并修复它。实际上我的构建是成功的并且没有错误。但为什么我不能使用 FTP 将任何简单网站发布到 IIS 10 服务器?

我应该在 IIS 服务器下启用 FTP 吗?但如果是这样呢?

请任何人提出想法,欢迎直接回答。

谢谢

今天我遇到了同样的问题,刚翻到这个问题,发现没有人回答,所以我想写下我是如何解决这个错误的。

所以,可能有更多的解决方案,但在我的情况下,我没有为网站传递正确的路径,我传递的是服务器上提到的完整路径,这导致了我上面提到的错误,为了解决这个问题,我修改了网站的完整路径,只有我愿意发布网站的文件夹名称。

因此,例如,我试图传递的是 h:\root\xx\xxxx\www\site1 site path 发布向导字段中的这条路径 visual studio。然后我只用 ftp 帐户的目录名替换了它, 我将网站的完整路径更改为 site1 并开始发布网站。

如果其他人 运行 遇到类似的问题,但是当您发布到一个已经存在的文件夹配置文件时:

在我的案例中,运行 Visual Studio 作为管理员解决了错误并且发布得很好!