-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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 returning ValueTask are not decompiled #1651
Comments
Actually the async state machine should be transformed back into a compilable method. Would you be able to provide the assembly, so that we can take a look and fix the problem? Thank you very much! |
I attempted to create a simple repro assembly, but in that assembly you were correct - it decompiled into an async method! This was the case unless I switched the C# version to 4.0 (pre-async), and then it output the generated code. In fact, then it also saved the generated code using "save code" 😁 The assembly I'm trying to decompile is System.Private.CoreLib.dll from https://github.com/dotnet/coreclr/tree/master/src/System.Private.CoreLib. In it, System.IO.FileStream.DisposeAsyncCore was having the issue (among others). Luckily, switching the version to 4.0 on that assembly also fixes the issue! So there's definitely a bug in that it's not decompiling back to async correctly (and references the generated code it doesn't actually output) when set to 7.0 or 8.0 with that assembly. However, this work-around works for me 👍 |
Example: |
|
When I right click an assembly and "save code" to create a project, it doesn't output the generated classes and methods that async methods reference.
I can see the generated code if I turn on "show all types and members", but it doesn't save the code to files. I get the same result using the ilspycmd utility.
Is it possible to output the generated code as well, so it generates a functional csproj?
The text was updated successfully, but these errors were encountered: