Reputation: 2861
I have a web application project that I publish via Visual Studio 2010 to my server. My problem is that it can take very long time before it can actually publish it. Maybe 10 minutes! It doesnt happen everytime but very often.
Here's a summary of what i have in the Output -> Build console when I try to publish:
When I open ProcessExplorer, I see that devenv.exe
is taking all the CPU. When I open this process, I see that the task that consume all the CPU is clr.dll!StrongNameSignatureVerification+0x11ee1
. As soon as this task finish, after 10 minutes, the publishing task finish quickly.
With Process Monitor, I have monitored the TID of clr.dll!StrongNAmeSignatureVerification and I've got MANY redondant events. For over 5 minutes, the task try to access a file that I don't have on my computer. He is searching for Microsoft.Build.Task.resources.dll
. It's like if the publishing task was trying again and again and again something that doesnt exist. For your information, I'm using Windows 7 French with Visual Studio 2010 English. On the screenshot, you see like 10 events of over 2000 events of the same thing!
Here is some info that can help to identify the problem:
I now know how to solve the problem BUT I don't know what is causing it. If I delete the **.suo file (at the same level as the .sln file) and i reopen Visual Studio, the publishing will be really fast. So reinitializing the .suo file seems to solve the problem each time the publishing get slow.
Just to make another test, I've made a backup of the .suo file when the publishing was slow and deleted it. Now the publishing is fast. If I copy the .suo file back to his position and reopen Visual Studio, the publishing will be slow again. So all seems to point to that file.
Any idea on this one?
Upvotes: 17
Views: 13245
Reputation: 1
I had similar problem, Visual Studio 2022 was taking 30 minutes to publish to a folder. After investing the issue, I found I had over 100GB of images in the bin and obj folders. After deleting these folders, Publishing ASP.NET website takes 10 seconds.
Upvotes: 0
Reputation: 550
Windows is far faster transferring 1 giant file than transferring thousands of tiny files, even it the net size is the same. So try this:
This accomplishes a couple things. 1) Its 1 giant file, not thousands of tiny files. 2) The compressed file will be compressed 50% to 80% so the data transfer over the wire will be that much smaller.
If you need a backup, its the same process in reverse but without publishing. I typically use L7.zip, but the built in windows zip will work. I don't know why Visual Studio cannot do this programmatically.
Upvotes: 0
Reputation: 1
I just experienced the same problem publishing to a network share and discovered that copying the files in Windows Explorer was also extremely slow. When I zipped the build folder and copied it across it took a few seconds. I conclude that the VPN OR Antivirus OR Firewall at one end or the other are adding some overhead to every file transfer.
Upvotes: 0
Reputation: 59
I am not sure if it's a suo file that is causing, but for me, this solved the problem.
After compiling, the publish will call aspnet_compiler, which actually takes longer as it is generating custom dll for all code.
But check with your VSPackages, is there any package written for some interpretation or so, that might be interrupting your publish.
Upvotes: 0
Reputation: 839
Try this way
In order to deploy the release on the development or production server, please follow the following steps.
Flag it as your answer if you have find it useful else let me know ...
Upvotes: 0