Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

SP2013 Custom Timer - Assebly not being removed after retracting solution.

$
0
0

Hi Folks,

I have a custom SP Timer feature written in visual studio 2013.4 that I have deployed to SP2013 Enterprise.  The timer has a feature receiver which on activation creates a custom timer job (and removes said job on de-activation).   The timer job simply iterates through a list on some sites and performs a calculation then outputs a result to a log file.   

The code contains some reflection to get the name and path of the executing assembly and log this as well.

The feature is set to install at the Farm level and the assembly is put in the GAC. The feature is set to Always force install.

If I deploy and activate the feature, run GACUTIL to check deployment, the assembly exists in the GAC.  A timer job is created and after 2 minutes executes - the log is correctly updated.

The issue is when I retract the solution.  If I check the GAC, the assembly has been correctly removed, the feature directory has been removed from the templates/features directory, the timer job has been removed and IIS apparently restarted. As far as I can make out, there is no remaining copy of the assembly on the system (and it does not execute or produce a log).

If I examine the hard drive for a copy of the assembly, there is just the one in the visual studio bin directory.

If I modify the code such as change a piece of logging data so I can see the change, and re-deploy,the OLD code gets executed (and an old copy of the assembly is run with the old logs) - but I cannot determine the location of where this assembly is executing as the reflection code reports the executing assembly as being the one just published (I believe because that's where the manifest points) - however it isnot this assembly.

If I restart the server, then the new assembly will execute.

Does anyone know how to can get SharePoint to correctly flush and reload the assembly?   I have tried IISReset to restart IIS but this appears not to fix the issue.


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>