简体   繁体   English

是什么触发Azure Functions重新加载引用的程序集?

[英]What triggers Azure Functions to reload the referenced assemblies?

I've been referencing external assemblies trying to work around the issue noted here: Azure Function Cannot Load Portable Assembly . 我一直在引用外部程序集试图解决此处提到的问题: Azure功能无法加载便携式程序集 However, often my function does not seem to reflect the changes made to the functionName\\bin assemblies. 但是,我的函数通常似乎没有反映对functionName \\ bin程序集所做的更改。 I've intentionally referenced the wrong assemblies, and then reran the function. 我故意引用了错误的程序集,然后重新启动了该函数。 I experience no change to what is logged (and I'm logging exceptions). 我没有对记录的内容进行任何更改(我正在记录异常)。

How do I force a complete reload of the Azure function? 如何强制完全重新加载Azure功能? Can I somehow see what Azure functions has as its "loaded" assemblies? 我可以以某种方式看到Azure功能作为其“加载”程序集具有什么?

If the only thing changing is the implementation and not the assembly identity (name, version, etc.), you'd indeed see this behavior as an assembly with a matching identity would already be loaded and that would be used. 如果唯一改变的是实现而不是程序集标识(名称,版本等),那么您确实会看到这种行为,因为已经加载了具有匹配标识的程序集并且将使用它。

Restarting your Function App site (under Function app settings > Go to app service settings > Restart) should trigger a host restart, which will force all assemblies to be reloaded. 重新启动功能应用程序站点(在“功能应用程序设置”>“转到应用程序服务设置”>“重新启动”)下应触发主机重新启动,这将强制重新加载所有程序集。

You can also Kill the non-scm w3wp.exe process using Kudu ( https://yourappname.scm.azurewebsites.net ), under Process Explorer, which will also force a host restart. 您还可以在Process Explorer下使用Kudu( https://yourappname.scm.azurewebsites.net )杀死非scm w3wp.exe进程,这也将强制主机重新启动。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM