Open Kagamia opened 1 year ago
It is not completely waste of time, I also meet the GraphicsControl memory leak bug (https://github.com/Kagamia/WzComparerR2/issues/196), still don't know the root cause but I'm trying to fix it.
Net6 alpha version released.
Here are some known issues:
Patcher
and Comparer
can't interrupt, will refactor to Task based functions to support these operation.
I'm trying to migrate wcR2 to .Net 6, but meet some blocking issue.
Here's the migration steps that I plan to take:
.csproj
to sdk-style project file, so that we can enjoy the latest C# lang feature.net462;net6.0-windows;netstandard2.0
and make it work. <- I'm blocking here.You know that wcR2 has strong dependence on
Dotnetbar2
. So far I can successfully build wcR2 when targeting net6.0, but can't open smoothly.Here's the first error:
It is really funny, by searching from msdn, we know that the
SetWindowTheme
function is declared inUxTheme.dll
, not inuser32
. Also checked the disassemble code:It checks the .net runtime version, if
Environment.Version
is equal to or greater than 5.1, then callSetWindowTheme
on itself to reset themes. This is also very confusing, I believe it should checkEnvironment.OSVersion
, because in .net Framework the version can't be greater than 5, so the function is never been called, and even no one was triggered the bug in the past 10 years.🤣Finally I use
Harmony
to hook the function and replace with an empty function, now we can start wcR2-net6 version smoothly, only find the UI layout is a bit incorrect.The second exception happens after loading base.wz and click any of the node:
Dotnetbar2
is .Net FX 2.0 compatible, so it still checksSystem.Windows.Forms.ContextMenu
type in its inner logic, but the class has already deprecated and removed from netcore codebase. see https://github.com/dotnet/winforms/pull/2157The class is not widely used, but the referenced function is very very long, I've no confidence that the decompiled code could work well. Also
ContextMenu
is used as property in some type, I can't remove them at runtime.Now I'm stopping here and posting this thread. 😿