我怎么知道我的 DLL 中的函数是从 Azure 函数还是简单的 Web 应用程序调用的

How can i know if the function in my DLL is called from azure function or simple web application

所以我有一个带有 DLL 的 Web 应用程序,可以说是函数 add()。

我正在编写一个具有我的 DLL 引用的 azure 函数 V1。

那么有没有办法让我确定我的 DLL 中的函数 add() 是否是从 azure 函数调用的

或者它是从我的网络应用程序调用的。

您可以使用 Caller Info attributes

By using Caller Info attributes, you can obtain information about the caller to a method. You can obtain file path of the source code, the line number in the source code, and the member name of the caller. This information is helpful for tracing, debugging, and creating diagnostic tools.