Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

aspnet core build slow only when publishing

I have an asp.net core web app. If I click build -> Rebuild, it finishes in just under 15 seconds.

However, if I publish it (via web deploy to azure, FTP to azure, or even just a file system publish to a local folder), it takes a very long time. Over a half hour before I give up and cancel it.

What is different about publishing that could cause this? How can I diagnose this to make it go faster?

I'm not sure if it's relevant, but it spends a long time outputting messages like this:

Added Item(s): ResolvedFileToPublish= C:\filepath\bg6.jpg CopyToPublishDirectory=PreserveNewest RelativePath=wwwroot\images\bg6.jpg TargetPath=wwwroot\images\bg6.jpg

like image 307
Kyle Avatar asked Oct 10 '18 21:10

Kyle


1 Answers

Try the following two ways

1.Try disabling windows defender on the machines where publish is slow to see if it fixes the issue.You could have some exclusions to the real-time protection.

2.Make the following settings in your project: Tools-> Options-> Projects and Solutions -> Build and Run -> MSBuild project build output verbosity

enter image description here

like image 50
Xueli Chen Avatar answered Oct 22 '22 21:10

Xueli Chen