 |
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
gir489 Grandmaster Cheater
Reputation: 14
Joined: 03 Jan 2012 Posts: 841 Location: Maryland, United States
|
Posted: Fri Oct 27, 2023 8:48 am Post subject: Unity Engine 2022 causes C# compilation errors. |
|
|
I am testing my table against the Valheim beta which has recently updated to Unity 2022. When attempting to call compileCS against it, I get the following error:
Compilation error:XX - The type 'System.Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=SomeBullshitHexThatImNotGonnaTypeOut'.
I googled the error, and in typical .NET environments, the solution is to add the newer runtime it wants to the build, but I don't think I can do that within the cheat engine script.
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25785 Location: The netherlands
|
Posted: Fri Oct 27, 2023 9:55 am Post subject: |
|
|
Code: |
compileCS(text, {references}, coreAssembly OPTIONAL)
|
the 3th parameter lets you specify which runtime to use. Is there perhaps a different .NET base file in the install path that fits better ? (CE just guesses otherwise based on the loaded modules)
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
 |
gir489 Grandmaster Cheater
Reputation: 14
Joined: 03 Jan 2012 Posts: 841 Location: Maryland, United States
|
Posted: Fri Oct 27, 2023 10:37 am Post subject: |
|
|
Dark Byte wrote: | Code: |
compileCS(text, {references}, coreAssembly OPTIONAL)
|
the 3th parameter lets you specify which runtime to use. Is there perhaps a different .NET base file in the install path that fits better ? (CE just guesses otherwise based on the loaded modules) |
Yeah which is what it's doing?
It's using D:\SteamLibrary\steamapps\common\Valheim\valheim_Data\Managed\netstandard.dll which is the library it's complaining about. It's using dotnetpatch_getAllReferences() to resolve that file. When I load netstandard.dll into DnSpy, it says its version is 2.1.0.0. There's 2 compileCS calls, one with the sysfile and one without. The one without causes the aformentioned error. With it, it just complains System.Object is not defined or imported.
Here is my script:
Code: | local references, sysfile=dotnetpatch_getAllReferences() --you're free to build your own list
local csfile,msg=compileCS(csharpscript, references, sysfile)
if csfile==nil then
--sometimes having the sysfile causes an issue. Try without
csfile,msg=compileCS(csharpscript, references)
if csfile==nil then
if msg==nil then msg=' (?Unknown error?)' end
messageDialog('Compilation error:'..msg, mtError, mbOK) --show compile error in a dialog instead of a lua error only
error(msg)
end
end |
I think it's just the same thing the auto hijacker does from the template.
EDIT: I had to supply it System.Core.dll from the Managed folder. Works now.
|
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|