Publishing my web application can take long time to accomplish because of the .suo file
Asked Answered
S

5

17

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:

  • The project is compiling - OK
  • Connecting to C:\Users{user}\Desktop\MyProjectTest... (this is where it can take up to 10 minutes)
  • The files are publishing...

enter image description here

Process Explorer

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.

enter image description here

Process Monitor

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!

enter image description here

More info on my setup

Here is some info that can help to identify the problem:

  • My application is build with MVC3
  • I have a few third party dlls. Some of them are signed.
  • I'm publishing with the File System method.
  • I tried to publish on my local computer and the problem is also there so its not a network problem between my computer and my server.
  • I have tested on Windows 7 x86 & x64 French edition
  • My Visual Studio 2010 SP1 is the English edition

UPDATE 2011-09-23

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?

Societal answered 14/9, 2011 at 19:40 Comment(6)
If you'd like to look at what exactly is happening network wise, you can try WireShark. (Keep in mind that if VS uses 100% of the CPU, everything is going to run slow)Babu
@rlb.usa, i have run Fiddler & Wireshark but i've found nothing but i have a new clue for my problem. I've used Process Monitor and discovered that there's alot of redondant events. I have edited the description.Societal
am sure if you are running strong name then you must be needing them, but incase it is any help have you seen this codeproject.com/KB/security/StrongNameExplained.aspx it may help to just run through some requirements and check you are all set right in order to do it.Iloilo
@minus4, thank you for the link but with all the research that i've done this weekend, its seems that its not a strong name problem. In fact, its a really weird problem since that today, my publishing is really fast and i havent changed anything yet :)Societal
I have had the same issue at two different customer sites, your suggestion to delete *.suo file has resolved the issue for me, and it does not seem to cause any other issues for me.Elegist
did you tried delete *.suo ?Levi
J
0

Try this way

In order to deploy the release on the development or production server, please follow the following steps.

  1. Install Web Deployment MSI.
  2. Right Click on the your project under the solution explorer and add the web deployment project( Here I am not using convert to web application or publishing)
  3. Then compile the files. This will create a folder in your project directory which will contain the required files to be deploy on the server.
  4. Take the back up of your virtual directory and remove the virtual directory as well as files from inetpub.
  5. Goto Inet mgr , type inetmgr in run hit enter.
  6. Under the default website, create a virtual directory, keep the deployed files in the inetpub and browser the files.
  7. Allow appropriate access such as read, run script and browse. That's all

Flag it as your answer if you have find it useful else let me know ...

Journalese answered 1/12, 2011 at 11:36 Comment(0)
U
0

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.

Uraeus answered 5/6, 2014 at 5:17 Comment(0)
H
0

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.

Hernardo answered 15/12, 2021 at 6:5 Comment(2)
kindly use the comment section for your discussions and doubts, not the answersWallin
That user doesn't have the reputation to do so.Tenace
P
0

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:

  1. Publish to a local file (not directly to the IIS file share).
  2. Zip the local files (these files will compress well).
  3. Use file explorer, delete the IIS file share files.
  4. Copy/paste the local zipped file to the network share.
  5. Unzip the files on the server using file explorer. (you will not have to remote into the server to do 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.

Peart answered 6/5, 2022 at 21:43 Comment(0)
S
0

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.

Street answered 19/4, 2023 at 18:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.