2

I have a phantom / cached .dll that I cannot get rid of in my SP Farm. I'm making updates to Example.dll, which contains an Email Event Receiver that I made changes to. Redeploying to the GAC and restarting the app pool simply doesn't work. The old dll is still running despite my every effort track it down and replace it.

I understand the SP Timer holds a version of this in memory. So after hours of reading I have tried the following (On all servers in the farm):

IISRESET (through cmd and IIS manager) GAC deployment (through drag n drop and gacutil /f) Reset SPTimer (through Services.msc and Powershell) Forcing other unrelated timer jobs to run Using Process Explorer to kill all associated processes Clearing the SP Config cache Looking for C:\Windows\assembly\temp (doesn't exist) Finally, Rebooting the Servers

The old code STILL RUNS!! What is going on? Where does this old assembly reside? I cannot redeploy the feature as my predecessor may be deleting lists on Feature Deactivation and it contains thousands of lines of code that would be much too risky. Help me please!

Colbs
  • 587
  • 10
  • 25
  • 1
    Could you please tell what kind of solution you have created? Maybe it is a sandbox solution? Also are you sure that assembly should be deployed to GAC? Please check if there is a copy of it in bin directory of web application (C:\Inetpub\wwwroot\wss\VirtualDirectories\80\bin). – Yevgeniy.Chernobrivets Nov 09 '13 at 21:43
  • tx for responding..The solution I've inherited was a SP 2007 farm scoped solution which contains dozens features. There is nothing in the 80\bin folder on the APP / WEB server. The dll is deployed to 2 GACs once I activate the wsp in central admin. I removed the dll from both GACs and the old code still runs. This is dll hell !! – Colbs Nov 11 '13 at 23:52
  • Maybe you have other versions of same assembly in GAC? – Yevgeniy.Chernobrivets Nov 14 '13 at 08:07

1 Answers1

1

you have to retract solution, restart timer, deploy again. make sure that dll is from the same solution.

modify this lines:

$solutionName="yousolution.wsp"

$SolutionPath="*H:*"+$solutionName

try out this power shell script:

function WaitForJobToFinish([string]$SolutionFileName)
{ 
    $JobName = "*solution-deployment*$SolutionFileName*"
    $job = Get-SPTimerJob | ?{ $_.Name -like $JobName }
    if ($job -eq $null) 
    {
        Write-Host 'Timer job not found'
    }
    else
    {
        $JobFullName = $job.Name
        Write-Host -NoNewLine "Waiting to finish job $JobFullName"

        while ((Get-SPTimerJob $JobFullName) -ne $null) 
        {
            Write-Host -NoNewLine .
            Start-Sleep -Seconds 2
        }
        Write-Host  "Finished waiting for job.."
    }
}

Add-PsSnapin Microsoft.SharePoint.PowerShell

$CurrentDir=$args[0]
$solutionName="yousolution.wsp"
#$SolutionPath=$CurrentDir + "\"+$solutionName 
$SolutionPath="H:\"+$solutionName 

Write-Host 'Going to uninstall solution'
Uninstall-SPSolution -identity $solutionName  -allwebapplications -confirm:$false

Write-Host 'Waiting for job to finish'
WaitForJobToFinish 

Write-Host 'Going to remove solution'
Remove-SPSolution -identity $solutionName -confirm:$false

Write-Host 'Restarting OWS Timer jobs'

$farm = Get-SPFarm
$farm.TimerService.Instances | foreach {$_.Stop();$_.Start();} 
 $farm = Get-SPFarm
$farm.TimerService.Instances | foreach {$_.Stop();$_.Start();} 
$farm = Get-SPFarm
$farm.TimerService.Instances | foreach {$_.Stop();$_.Start();} 
$farm = Get-SPFarm
$farm.TimerService.Instances | foreach {$_.Stop();$_.Start();} 
Write-Host 'Going to add solution'
Add-SPSolution $SolutionPath

Write-Host 'Going to install solution to all web applications'
Install-SPSolution -identity $solutionName -allwebapplications –GACDeployment -Force

Write-Host 'Waiting for job to finish' 
WaitForJobToFinish 

Remove-PsSnapin Microsoft.SharePoint.PowerShell

find you dll here: C:\Windows\assembly and compare if its updated.

Vitali K
  • 136
  • 1
  • 8