Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Async methods cause null reference exception #12

Open
marktoman opened this issue Mar 27, 2019 · 1 comment
Open

Async methods cause null reference exception #12

marktoman opened this issue Mar 27, 2019 · 1 comment

Comments

@marktoman
Copy link

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
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants