Comments (4)
Greetings!
Based on the stack trace, the issue is not related to HarmonyX, but rather BepInEx and how your plugin is set up.
I'll address the issue here, but next time please create issues related to BepInEx in BepInEx repo instead.
Since the error actually happens when your plugin is loaded, the problem is likely in your plugin project setup.
Monster Sanctuary is using normal .NET Framework -equivalent API (as evidenced by lack of netstandard.dll
in game's _Data\Managed
folder). BepInEx core DLLs themselves are built to support both .NET Standard and .NET Framework APIs, so it leaves only your plugin DLL.
Make sure your plugin is built targeting .NET Framework and not .NET Standard. This is well documented in BepInEx plugin development documentation.
In nutshell, check version of mscorlib.dll
in game's Managed
folder: if it's 4.0.0.0
or higher, you can usually target .NET Framework 4.6; in case of lower versions target .NET Framework 3.5. If you are unsure, targeting .NET Framework 3.5 is always a safe bet (although you won't get all available API and there can be problems with referencing some game DLLs).
Refer to the documentation of the development tools you use on how to change the target framework.
from harmonyx.
Ah I see, Thank you.
Sorry I assumed it was HarmonyX related because it happened when calling a HarmonyX function, just running a Debug.Log("test") inside of Awake() worked fine and printed to the BepInEx console so my assumption was that everything else was working fine.
from harmonyx.
Sorry I assumed it was HarmonyX related because it happened when calling a HarmonyX function
This most likely happened because when calling PatchAll, your assembly happened to reference some type that in .NET Standard is part of netstandard.dll
which added the assembly as a dependency to your plugin DLL. Same will happen if you use something like StringBuilder
API.
One way to check it is via tools like ilSpy or dnSpy which allow you to look at the contents of managed DLLs. Very likely your plugin DLL has the netstandard
as one of references when using PatchAll which is indicative of plugin being built against .NET Standard API.
from harmonyx.
Yep it works now!
Thank you so much ❤️ Sorry again for posting in the wrong repo.
from harmonyx.
Related Issues (20)
- [Wiki] Typos in section 1.4 HOT 1
- [Wiki] Error using the provided postfix in section 1.4 HOT 1
- When will v2.11.0 be published on NuGet? HOT 2
- Android IL2CPP Support HOT 2
- v2.11.0: patch with "ref string" on "static external" method produces garbage HOT 5
- Harmony doesn't work when path contains non-ANSI characters HOT 1
- How do I call a private function within a postpatch HOT 8
- How do I find the asset directory of stuff stored in a unity game? HOT 1
- Reverse patches appears to be broken
- Assembly.GetExecutingAssembly causing game to crash HOT 8
- System.Reflection.Emit.ILGeneration is not supported on this platform when using Transpilers. HOT 5
- HarmonyX 2.13 in 7dtd: Interface Default Implementations failing to patch with odd error.
- Empty Transpiler Causing Issues HOT 1
- How to override explicit interface methods? HOT 1
- When did it start to support net 7 or 8? HOT 1
- Cannot unpatch extern method patch
- Patching ref parameter with IL2Cpp results in invalid IL
- Usage with unity
- Empty Harmony Annotations Cause ArguementException: No Target Method Found HOT 2
- Skipping a patch when a method isnt found HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from harmonyx.