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

Native async patching is not available in .NET Standard or .NET #533

Closed
Nihlus opened this issue Jun 16, 2023 · 2 comments
Closed

Native async patching is not available in .NET Standard or .NET #533

Nihlus opened this issue Jun 16, 2023 · 2 comments
Assignees

Comments

@Nihlus
Copy link

Nihlus commented Jun 16, 2023

Describe the bug
The Async method type and its associated helpers are not available outside of .NET Framework due to the use of the NET45_OR_GREATER compile-time definition. This define is not set in .NET Standard or modern .NET despite the name suggesting as such at first glance. These targets support asynchronous code and should have the code available.

Adding NETSTANDARD1_0_OR_GREATER and NETCOREAPP1_0_OR_GREATER as || options to the #if clauses should resolve the issue.

To Reproduce
Steps to reproduce the behavior:

  1. Install Harmony's prerelease in a .NET Standard or .NET project (not .NET Framework)
  2. Attempt to use an Async method target or AccessTools.AsyncMoveNext
  3. Observe compile error

Expected behavior
The functionality should be available.

Screenshots / Code
If applicable, add material to help explain your problem.

Runtime environment (please complete the following information):

  • OS: Linux Mint 21
  • .NET 7
  • Harmony 2.3.0-prerelease.2
@pardeike
Copy link
Owner

Can you verify with master that this is no longer a problem?

@Nihlus
Copy link
Author

Nihlus commented Jun 18, 2023

Yep, seems to work fine.

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