Puresharp
Puresharp copied to clipboard
Async methods cause null reference exception
When I pass a .NET Core 2.2 exe to IPuresharp, it fails if the exe has async methods that contain certain constructs:
using System;
using System.Threading.Tasks;
namespace AsyncWeavingTest
{
class Program
{
static void Main(string[] args) { }
// Works
Task Method1() => Task.CompletedTask;
void Method2() { var t = new Task(() => { }); t.Start(); }
async Task Async1() { }
async Task Async2() { var t = new Task(() => { }); t.Start(); }
async Task Async3() { await new Task(() => { }); }
// Fails
async Task Async4() { var t = new Task(() => { }); t.Start(); await t; }
async Task Async5() { await Task.CompletedTask; }
}
}
Also, thank you for this project. I was looking for a decent AOP solution for quite a while.
Thank you for sharing issue, I will try it as soon as possible.