1

With SharePoint you can use a Feature Receiver to perform some actions when a feature is installed/uninstalled etc.

The feature receiver is ran from the OWSTIMER service and the process seems to be roughly

  • .wsp (a cab file) is unpacked and examined
  • .dll's are moved to bin/gac
  • feature receivers marked in manifest are called (can only be in GAC) by the service

However OWSTIMER keeps a handle open on the dll containing the feature receiver.

This means that when you uninstall the feature Fusion will move the dll to the c:\windows\temp\ directory and still keep the reference. (More details here and here)

When you then try and install the new version (assembly file version different but assembly version has to remain the same) OWSTIMER will run the OLD feature receiver.

You can stop this occurring with a restart of the OWSTIMER service but this is not practical on a production farm environment where there may be many web servers.

Anyone know of any workarounds?

4

2 回答 2

0

Do an iisreset between swapping over features.

Yes, brings down all the web apps but that's why you have planned outages / do it out of hours. And make sure the process is well rehearsed on your dev machines.

于 2011-02-18T23:59:23.503 回答
0

没有变通方法,但是在您有许多服务器的生产环境中,您不应该从 GAC 手动 GAC-ing 和 un-GAC-ing DLL。

如果您通过功能体系结构进行部署,SharePoint 将自动处理此问题。

也就是说,如果您需要在场中的多个服务器之间同步 Windows 服务(包括 OWSTIMER 和 IIS)的启动/停止,只需编写一个批处理脚本即可使用:

SC \\SERVER1 STOP W3SVC
SC \\SERVER1 STOP SPTIMERV4
SC \\SERVER2 STOP W3SVC
SC \\SERVER2 STOP SPTIMERV4

然后使用以下命令重新启动:

SC \\SERVER1 START SPTIMERV4
SC \\SERVER1 START W3SVC
SC \\SERVER2 START SPTIMERV4
SC \\SERVER2 START W3SVC
于 2013-11-25T18:43:38.153 回答