Async logging throwing a NullReferenceException

前端 未结 3 365
既然无缘
既然无缘 2021-01-02 06:35

I am trying to asynchronously log some information to SQL Server inside of an MVC 4 controller action targeting .NET 4.0 using the AsyncTargetingPack. I would jump straight

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-02 07:11

    I had this problem with .net4.5 when my web service was invoking another WCF service in an async manner. I simply appended a short timed Wait() as I didn't care about the response (telemetry event).

    public static void Event(string key, string message) {
        Telemetry.Event(key, message).Wait(100);
    }
    

提交回复
热议问题