I’m here trying to repurpose a lethal company mod and using Harmony to patch the files, but when I try to build the dll file on vsc i keep getting this same error.
I’ll send the code. The error occurs at line 65 to 68.
using System;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using GokuBracken.Patches;
using HarmonyLib;
using UnityEngine;
namespace GokuBracken.Core
{
// Token: 0x0200000B RID: 11
[BepInPlugin("", "", "")]
public class GokuBrackenBase : BaseUnityPlugin
{
// Token: 0x1700001A RID: 26
// (get) Token: 0x0600004C RID: 76 RVA: 0x000022D6 File Offset: 0x000004D6
// (set) Token: 0x0600004D RID: 77 RVA: 0x000022DD File Offset: 0x000004DD
internal static GokuBrackenBase Instance
{
get
{
return GokuBrackenBase._instance;
}
set
{
if (GokuBrackenBase._instance == null)
{
GokuBrackenBase._instance = value;
return;
}
UnityEngine.Object.Destroy(value);
}
}
// Token: 0x1700001B RID: 27
// (get) Token: 0x0600004E RID: 78 RVA: 0x000022F9 File Offset: 0x000004F9
public static ManualLogSource LogSource
{
get
{
return GokuBrackenBase.Instance.Logger;
}
}
// Token: 0x1700001C RID: 28
// (get) Token: 0x0600004F RID: 79 RVA: 0x00002305 File Offset: 0x00000505
public static ConfigFile ModConfig
{
get
{
return GokuBrackenBase.Instance.Config;
}
}
// Token: 0x06000050 RID: 80 RVA: 0x00002DD8 File Offset: 0x00000FD8
private void Awake()
{
GokuBrackenBase.Instance = this;
base.Logger.LogInfo("Initializing config...");
ConfigManager.InitializeConfig();
base.Logger.LogInfo("Loading asset bundle...");
Assets.PopulateAssets();
base.Logger.LogInfo("");
base.Logger.LogInfo("");
this.Harmony.PatchAll(typeof(GokuBrackenBase));
this.Harmony.PatchAll(typeof(EnemyPatches));
this.Harmony.PatchAll(typeof(TerminalPatches));
this.Harmony.PatchAll(typeof(RoundManagementPatches));
}
// Token: 0x04000018 RID: 24
private static GokuBrackenBase _instance;
// Token: 0x04000019 RID: 25
private readonly Harmony Harmony = new Harmony("");
}
}
note that EnemyPatches, TerminalPatches, and RoundManagementPatches are cs files.
I tried using Assembly.GetExecutingAssembly and GetCallingAssembly, but it still gives me a similar error.
New contributor
Noon Animates is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.