IIS FTP 7.5: custom extension assembly gets cached and won't be updated

佐手、 提交于 2019-12-13 02:23:52

问题


IIS FTP 7.5 on Windows 7 caches the assembly with custom extension (managed code, C#).

Once you start the server for the first time with that library file, new versions of it will not be picked up, regardless of whether you restart server, install-uninstall from GAC etc.

The only way to get the new implementation file into IIS FTP is to change the version name in the strong name.

Is there a way to replace the implementation without changing the version number, simply by replacing the file?

This weird behavior makes debugging and change mgmt nearly impossible.

Similar behavior was observed by Artiom at this post: http://www.flexlabs.org/IIS7-Modules/custom-authentication-extension


回答1:


Found the reason for this "caching".

IIS runs extensibility components in a COM+ application called "Microsoft FTP Publishing Service Extensibility Host". Once the extension is loaded, the assembly is loaded into corresponding process (hosted by dllhost.exe) and thus is not immediately affected by any GAC changes.

Working solution (covers a bit more elements than the scope of the original question):

  • FTP service is configured to load my extension component written using .NET 3.5 - because it ONLY accepts .NET 2.0 runtime; if you implement extension in runtime 4 it simply won't run

  • extension component, in its turn, needs large codebase that is implemented using .NET 4.5 - and it does so via COM (those APIs are registered in COM, but not in GAC)

  • when I recompile the FTP service extension, it is enough to update GAC and shutdown the "Microsoft FTP Publishing Service Extensibility Host" COM+ application and, preferably, FTP service too.

Now I do not have to change the strong name (by changing version number) of the FTP service extension assembly for every change.



来源:https://stackoverflow.com/questions/19370878/iis-ftp-7-5-custom-extension-assembly-gets-cached-and-wont-be-updated

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!