MOSS Forum

Ask Question   UnAnswered
Home » Forum » MOSS       RSS Feeds

FeatureReceiver works on only ONE farm server !?

  Asked By: Eliseo    Date: Feb 23    Category: MOSS    Views: 1511

I have a farm scope solution that will deploy across the farm, but the
FeatureReceiver won't fire on all the servers.

All the FeatureReceiver events (FeatureActivated(), ...) only fire on
the server I installed/deployed from. In fact, if I install/deploy on
one WFE server, then activate on another WFE server, the
FeatureReceiver events fire on the first server.

So, now I'm left with a feature that copies some webroot files
(WebUserControls, Config files, RadControls/) into place on ONE of my
WFE servers. Then I have to manually copy the files to the other(s).



7 Answers Found

Answer #1    Answered By: Jermaine Schmidt     Answered On: Feb 23

Are you using a WSP CAB to deploy  your Feature? What are the elements
you are using to put your controls onto the server? Are you putting them
into ..\12\CONTROLTEMPLATES\Custom or somewhere else?

Answer #2    Answered By: Tyrone Meyer     Answered On: Feb 23

I've got a few solutions/features (WSP) that need to have files  deposited
into the webroot.

In 2003 I put my ascx files into <webroot>/WebUserControls
In 2003 I put my config  files into <webroot>/Config
In 2007 I need my Telerik RadControls files in <webroot>/RadControls

I could change the code for some of these to avoid the question, but I still
need files in webroot for RadControls (I packaged up DLLs and support files
so I can distribute some Telerik ASP.net controls uniformly to my farm).
Since I can't avoid the problem altogether, I'm looking for the common
denominator answer of how to have solutions/features copy  files to webroot.

It actually makes sense that a FeatureReceiver runs only once on one farm
server when you consider they normally register global changes (like new
templates, or lists, or whatever in the database). But, surely there is a
way to tell SharePoint to invoke it on all farm  servers... or at least let
me distribute files outside of the TEMPLATES directory.

Answer #3    Answered By: Dean Neal     Answered On: Feb 23

If I remember correctly, the event receiver runs on the server  that
hosts the web application. Are you seeing something different?

Answer #4    Answered By: Vincent Griffin     Answered On: Feb 23

What would you expect for a farm  running one SharePoint 2007 install?
It's my understanding (wrong?) that one web application can be served by
several web front ends (WFE) in a farm.
In that case, wouldn't all the WFEs be peers for that web application?

I found that the one WFE that I installed the WSP solution  on was the one
that fired the FeatureReciever event handler when activated. Even if I
activated it from another server, the original server  ran the

The strangest issue is what happens if the server you originally installed
the WSP on goes offline for any reason? If you later activate/deactivate the
feature, which server calls the FeatureReceiver then?

Answer #5    Answered By: Antoine Barker     Answered On: Feb 23

Solution deployment happens on all servers  in a farm. Feature activation
does not. Sadly, there is no SolutionDeployed event.

A Timer Service Job might help. You can specify the server  on which the
job should run, and in your case, submit multiple jobs to each farm

Answer #6    Answered By: George Watson     Answered On: Feb 23

Instead of moving the files  using an assembly create a feature  with a
Module Element to ghost the files to the root of the site. Then deploy
the feature and activate  it using a WSP.

Answer #7    Answered By: Gabriel Patterson     Answered On: Feb 23

If WebUserControls, Config, and RadControls can be virtual locations
(likely), why not "copy" them into your Web Application using a Module
Feature? In other words, these files  wouldn't be copied into the webroot
on the file system but rather they would be virtually copied into "/"
within the content database.

Be aware, files virtually (Ghostable and GhostableInLibrary) or
physically (Unghosted) copied into the content database are not removed
when a Feature is deactivated. You must code their removal within the
FeatureDeactivated callout.

Didn't find what you were looking for? Find more on FeatureReceiver works on only ONE farm server !? Or get search suggestion and latest updates.