Skip to content

Async methods cause null reference exception #12

Description

@marktoman

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions