sharepoint: FeatureUninstalling is called AFTER event receiver assembly
has been uninstalled from GAC
There is an SP solution that contains a web application feature. When
activating - this feature modifies web config of the target web
application(registers an HTTPModule).
If user activates the feature and then retracts the solution while feature
is active - the web application will crush because web config will still
contain modifications when the DLL with HTTPModule definition is no longer
available in GAC.
So I've implemented the FeatureUninstalling method and want to remove my
modifications, but this method is never called.
After some research I've found from ULS Logs that the Timer Job is trying
to call feature event handler AFTER it removes DLL from GAC.
There are following lines in the log:
Solution Deployment : UpdateFiles - Processing file my_assembly of Type
GlobalAssembly FileDir
Solution Deployment : Uninstalling from GAC - [my_assembly_full_name]
.....
Solution Deployment : Success : retraction for [my_solution].wsp Target
global
....
Solution Deployment : Removing feature for [my_solution].wsp Target global
....
Feature receiver assembly '[my_assembly_full_name]', class
'[my_event_receiver_class]', method 'FeatureUninstalling' for feature
'...' threw an exception: System.ArgumentException: Failed to load
receiver assembly "[my_assembly_full_name]" for feature ...
System.IO.FileNotFoundException: Could not load file or assembly
'[my_assembly_full_name]' or one of its dependencies. The system cannot
find the file specified
Is it a problem that it calls FeatureUninstalling when DLL is removed from
GAC? Or there is some problem with loading an assembly? How can I
investigate this issue?
No comments:
Post a Comment