We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug The patch I wanna do works when built with x64/AnyCPU platform but it doesn't work with x86 platform
To Reproduce
public static void Patch() { Harmony harmony = new Harmony("TestPatch"); foreach (Type type in Assembly.GetAssembly(typeof(TimeZone)).GetTypes() .Where(myType => myType.IsClass && !myType.IsAbstract && myType.IsSubclassOf(typeof(TimeZone)))) { MethodInfo originalMethod1 = type.GetMethod("ToLocalTime"); var preFixMethodInfo1 = typeof(Program).GetMethod("PrefixTest", BindingFlags.Static | BindingFlags.NonPublic); HarmonyMethod prefix1 = new HarmonyMethod(preFixMethodInfo1); harmony.Patch(originalMethod1, prefix1, null, null, null); } } static void Main(string[] args) { Patch(); DateTime date3 = TimeZone.CurrentTimeZone.ToLocalTime(DateTime.Now); } static bool PrefixTest(ref DateTime __result, DateTime __0) { __result = DateTime.UtcNow; return false; }
The result is quite random. AccessViolationException / System.ExecutionEngineException / random "date3" values returned
Expected behavior TimeZone.CurrentTimeZone.ToLocalTime with the current prefix code should return DateTime.UtcNow
Runtime environment (please complete the following information):
Additional context Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
pardeike
No branches or pull requests
Describe the bug
The patch I wanna do works when built with x64/AnyCPU platform but it doesn't work with x86 platform
To Reproduce
The result is quite random. AccessViolationException / System.ExecutionEngineException / random "date3" values returned
Expected behavior
TimeZone.CurrentTimeZone.ToLocalTime with the current prefix code should return DateTime.UtcNow
Runtime environment (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: