3
votes

I'm running visual studio 2017, I'm trying to FTP deploy a .net-core 2.0 project to my server. My project builds fine normally but when I attempt to publish I get an error:

System.AggregateException: One or more errors occurred. ---> System.Exception: Build failed. Check the Output window for more details. --- End of inner exception stack trace --- at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) at Microsoft.VisualStudio.Web.Publish.PublishService.VsWebProjectPublish.<>c__DisplayClass40_0.b__2() at System.Threading.Tasks.Task`1.InnerInvoke() at System.Threading.Tasks.Task.Execute()

This issue only occurs when I publish. A bunch of error popup in the output window for third party dlls Microsoft.AspNetCore.StaticFiles and System.IdentityModel.Tokens.Jwt

Any idea on how I can get publish working?

3
that is a bit unusual, but I've found publish does attempt to use separate settings files for some types of projects. Are you doing an async await/task when reading AppSettings? do you have DependencyInjection framework setup? - Brett Caswell
@BrettCaswell all of my controllers are async but I don’t manually read from app settings at all - johnny 5
also, have you tried a local release build to see if you can't reproduce this? typically we build and test in debug and publish in release. there may be a configuration issue you aren't experiencing because of the directives. - Brett Caswell
Updating my visual studio fixed this issue - johnny 5
For anyone else experiencing this issue. The way I can consistently publish is, publish locally to a folder first, and then manully ftp that folder to the server - johnny 5

3 Answers

2
votes

For what it's work, I had the exact same error:

System.AggregateException: One or more errors occurred. ---> System.Exception: Build failed. Check the Output window 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__DisplayClass43_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__127.MoveNext()
---> (Inner Exception #0) System.Exception: Build failed. Check the Output window for more details.<---

And the remote server was out of disk space. The publish console didn't show anything after the publish, but if I scroll up I start to see this:

2>Unable to add 'Scripts/jquery-3.4.1.js' to the Web site.  Unable to add file 'Scripts\jquery-3.4.1.js'.  There is not enough space on the disk.

Moral of the story this error seems to point towards something external to the project itself. Hopefully that helps someone.

1
votes

Take a look at FolderProfile.pubxml file located in YourProject\Properties\PublishProfiles and make sure term is configured with correct version.

0
votes

For VS2019 and IIS 10, Recycling the application pool the application uses that you're deploying worked for me.