{"action":"created","issue":{"url":"https://api.github.com/repos/Fody/MethodDecorator/issues/35","repository_url":"https://api.github.com/repos/Fody/MethodDecorator","labels_url":"https://api.github.com/repos/Fody/MethodDecorator/issues/35/labels{/name}","comments_url":"https://api.github.com/repos/Fody/MethodDecorator/issues/35/comments","events_url":"https://api.github.com/repos/Fody/MethodDecorator/issues/35/events","html_url":"https://github.com/Fody/MethodDecorator/issues/35","id":138508883,"number":35,"title":"Asynchronous methods calling OnExit too Early","user":{"login":"Tybielee","id":9011308,"avatar_url":"https://avatars.githubusercontent.com/u/9011308?v=3","gravatar_id":"","url":"https://api.github.com/users/Tybielee","html_url":"https://github.com/Tybielee","followers_url":"https://api.github.com/users/Tybielee/followers","following_url":"https://api.github.com/users/Tybielee/following{/other_user}","gists_url":"https://api.github.com/users/Tybielee/gists{/gist_id}","starred_url":"https://api.github.com/users/Tybielee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tybielee/subscriptions","organizations_url":"https://api.github.com/users/Tybielee/orgs","repos_url":"https://api.github.com/users/Tybielee/repos","events_url":"https://api.github.com/users/Tybielee/events{/privacy}","received_events_url":"https://api.github.com/users/Tybielee/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-04T15:54:59Z","updated_at":"2016-03-24T20:23:38Z","closed_at":null,"body":"I was doing a simple test that uses both MethodTimer fody package and the MethodDecorator to hopefully achieve something I require. However, when simply testing the project out with Console.Write(\"OnExit\"); in the OnExit method, it seems to be printed far sooner than one expects for an asynchronous method. I know that the asynchronous method itself has not yet finished because the MethodTimer is measuring the execution time and that doesn't output to the console until a few seconds later. \r\nAm I missing something as to what kinds of async are allowed? Or can anyone point me in the right direction of getting asynchronous methods to work?"},"comment":{"url":"https://api.github.com/repos/Fody/MethodDecorator/issues/comments/201004146","html_url":"https://github.com/Fody/MethodDecorator/issues/35#issuecomment-201004146","issue_url":"https://api.github.com/repos/Fody/MethodDecorator/issues/35","id":201004146,"user":{"login":"FrancoisM","id":3176568,"avatar_url":"https://avatars.githubusercontent.com/u/3176568?v=3","gravatar_id":"","url":"https://api.github.com/users/FrancoisM","html_url":"https://github.com/FrancoisM","followers_url":"https://api.github.com/users/FrancoisM/followers","following_url":"https://api.github.com/users/FrancoisM/following{/other_user}","gists_url":"https://api.github.com/users/FrancoisM/gists{/gist_id}","starred_url":"https://api.github.com/users/FrancoisM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FrancoisM/subscriptions","organizations_url":"https://api.github.com/users/FrancoisM/orgs","repos_url":"https://api.github.com/users/FrancoisM/repos","events_url":"https://api.github.com/users/FrancoisM/events{/privacy}","received_events_url":"https://api.github.com/users/FrancoisM/received_events","type":"User","site_admin":false},"created_at":"2016-03-24T20:23:38Z","updated_at":"2016-03-24T20:23:38Z","body":"It seems to work for me.\r\nHowever if your target async method throw an exception then OnExit is called (but not OnException which doesn't catch async exceptions) and this is surely what you see."}}