если я попытаюсь получить экземпляр активности, вызвав
Код: Выделить всё
Activity.Current
a console project, I get a null
Код: Выделить всё
class Program
{
static void Main(string[] args)
{
var activity = Activity.Current; // activity is null
// ...
}
}
Код: Выделить всё
[ApiController]
public class PingController : ControllerBase
{
[HttpGet("ping")]
public async Task PingAsync()
{
var activity = Activity.Current; // activity is NOT null
// ...
}
}
Код: Выделить всё
Activity
Код: Выделить всё
Activity
Код: Выделить всё
Activity.Current
Источник: https://stackoverflow.com/questions/781 ... -in-asp-ne