Resolved CS0433

ryzr3

New member
Joined
Apr 12, 2023
Messages
4
Programming Experience
Beginner
please help with this code
[HarmonyPatch(typeof(GorillaLocomotion.Player))]
[HarmonyPatch("FixedUpdate", MethodType.Normal)]

and

var harmony = new Harmony(modGUID);
harmony.PatchAll(Assembly.GetExecutingAssembly());

these 2 code are coming up with CS0433 and idk why and how to fix this
ty i only started learning today
~RYZ
 
When you are posting for help with a compilation error, please provide the error message and not just the code. If you provide just the code, each one of us who wants to help has to look up that code for ourselves to find the corresponding error message that you already know and could have provided.
 
When you are posting for help with a compilation error, please provide the error message and not just the code. If you provide just the code, each one of us who wants to help has to look up that code for ourselves to find the corresponding error message that you already know and could have provided.

sorry i didnt know, is this helpful?
var harmony = new Harmony(modGUID);
harmony.PatchAll(Assembly.GetExecutingAssembly());
}
}

[HarmonyPatch(typeof(GorillaLocomotion.Player))]
[HarmonyPatch("FixedUpdate", MethodType)]

and the error code is

Error CS0433 The type 'HarmonyPatch' exists in both '0Harmony, Version=2.9.0.0, Culture=neutral, PublicKeyToken=null' and '0Harmony20, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null'
 
Last edited:
Yes. And that error tells you exactly what is wrong. The class name is available in two places. The compiler doesn't know which one you are referring to. So you need to qualify the name to tell the compiler which is which.
 
You appear to have imported two different versions of the Harmony library. Check your references and ensure that only one version exists
 
Yes. And that error tells you exactly what is wrong. The class name is available in two places. The compiler doesn't know which one you are referring to. So you need to qualify the name to tell the compiler which is which.
Kind of hard to qualify the name when two referenced assemblies have the same namespace and class name.
 
Back
Top Bottom