Puresharper / Puresharp

Puresharp is a Framework that provides the essential APIs (AOP, IOC, etc...) to productively build high quality (.NET 4.5.2+ & .NET Core 2.1+) applications through reliability, scalability and performance without no compromise
MIT License
143 stars 17 forks source link

Async methods cause null reference exception #12

Open marktoman opened 5 years ago

marktoman commented 5 years ago

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.

Puresharper commented 5 years ago

Thank you for sharing issue, I will try it as soon as possible.