Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

The following issue just crept up on me. The steps mentioned below had worked just fine until about 2 days ago.

When I deploy a update to a solution (of web parts) to a SharePoint 2010 server I don't see the update. The solution does get installed, but from what I can tell the installed web parts are over a month old (nothing new is installed).

I do the following steps through PowerShell:

retract the solution from the web app
remove the solution  
add the solution  
install the solution to the web app

I have tried restarting the Web App, restarting IIS and also restarting the server. Nothing seems to work.

I notice that after I remove the solution it does get removed from the GAC. After I add/install it the solution does reappears in the GAC.

Am I missing something? Am I overlooking a step that I should be doing? Something to try?

share|improve this question
    
Are you sure you recompiled the webpart DLL and copied the release version into your solution? –  Kit Menke Jan 10 '11 at 20:20
    
Yes. I also took the wsp, renamed it to a cab file and looked at the contents. The contents are what I suspect they should be (the new stuff). –  mcnarya Jan 10 '11 at 22:37
add comment

5 Answers 5

up vote 3 down vote accepted

if you work with powershell ensure that the thread that does the retract and remove is stopped and the deployment happens in a new thread.

This is also relevant if you update FeatureReceivers from within a powershell script. You have to start the deployment/feature activation in a separate thread, otherwise the DLL is not released from GAC and remains the old one. At least until a restart, but especially for automated feature activation, that's not enough.

Hope this helps :)

share|improve this answer
    
Tobi led me on the right path to solving my issue. From what I can tell everything that I was doing was correct, except for one step. I never deactivated/reactivated the Feature. After following the same steps I mentioned in my question I just deactivated, then reactivated, the Feature and everything started to working fine. This is an easy thing to I can start to implement with my solution updates. However, why did I never have to do this step before? Thanks to all for the suggestions. –  mcnarya Jan 11 '11 at 20:47
    
I'm glad I could help you with that one :) –  Tobi Jan 12 '11 at 9:36
add comment

Is some part of the GAC dlls perhaps used by the Timer Service? In that case you may want to restart that one as well.

Otherwise try using the free process explorer to carry out a search for handles that have references to the GAC dlls.

share|improve this answer
add comment

It might be worth trying bumping the assembly version. That would also make it easy to track in the target GAC.

Logic suggests something has gone wrong in getting the wsp from your dev environment to your production server where you are installing it - although I am sure you have considered this.

Don't forget to double-check the location of the wsp in your add-spsolution powershell or stsadm command.

share|improve this answer
add comment

When do you do the restart/reset, before you remove the solution? Or when you have added it back in? I have noticed that if a process is accessing a dll in the GAC when you try to remove it, sometimes it wont do it. If you ensure all the processes are stopped, hopefully there wont be any issues (a similar way to how visual studio does its deploy when you are developing). Also, if this is a multi-server environment, wait until the solution has been retracted from all servers before adding it back in. You may have to manually remove it from the GAC on the non-primary server.

See if this process fixes it up

for all servers
    iisreset /restart
    net stop sptimerv4
    net start sptimerv4
    net stop sptracev4
    net start sptracev4

retract the solution from the web app
remove the solution  
wait

for all servers
    check c:\windows\assembly, if not removed
        iisreset /stop
        net stop sptimerv4
        net stop sptracev4
        delete dll from GAC

for all servers
    iisreset /restart
    net stop sptimerv4
    net start sptimerv4
    net stop sptracev4
    net start sptracev4

add the solution  
install the solution to the web app
wait

for all servers
    iisreset /restart
    net stop sptimerv4
    net start sptimerv4
    net stop sptracev4
    net start sptracev4
share|improve this answer
add comment

one more thing, you are writing about WebParts....do you mean the .dwp file in the WebPart Gallery that is not renewed?

To ensure this, you should insert a feature deactivation handler that removes the WebPart from the gallery when the Feature is deactivated.

Try using wspBuilder (e.g. new Test-Project) to get the code that removes the WebPart automatically on deactivate.

Hope this helps :)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.