Harmony icon indicating copy to clipboard operation
Harmony copied to clipboard

Please support for .NET Standard 2.0

Open siakun opened this issue 1 year ago • 3 comments

I am using Unity and downloaded this package through NuGet for Unity. Unfortunately, the NuGet package from this repository only contains a _._ file within the netstandard2.0 folder, indicating that actual support for .NET Standard 2.0 might be missing.

Could you please provide proper support for .NET Standard 2.0 to enhance compatibility with Unity?

Thank you!

siakun avatar Apr 17 '25 02:04 siakun

Unity's .NET Standard 2.0 API doesn't support dynamic code generation, afaik. For Unity use HarmonyX it is, to quote the readme, "a fork of Harmony 2 that specializes on support for games and game modding frameworks." It is powered by MonoMod and specifically made to be used with Unity and is used by both big Unity Mod loaders BepInEx & MelonLoader.

TECHN0TRADE avatar Apr 17 '25 17:04 TECHN0TRADE

Harmony's implementations depend on the specific runtime. As such it can't provide an implementation for netstandard. However, it does provide a reference assembly for netstandard code to compile against - but the right runtime assembly has to be provided for execution.

Banane9 avatar Apr 18 '25 12:04 Banane9

If you need more information about how to get Harmony running in a NetStandard runtime, please visit our discord. I’ll close this issue for now.

pardeike avatar Apr 18 '25 12:04 pardeike