Custom extension not loading after update
Discussion in 'Rust Development' started by Kolyma, Oct 21, 2017.
-
Wulf Community Admin
-
Which would also require adding the Oxide.MySql.dll to the existing project's references. Wasn't aware that the intention was to move away from referencing the dll the old way at the top. Still failing to compile both on start and on reload.
Error while compiling: AutoDoors.cs(19,37): error CS0234: The type or namespace name `MySql' does not exist in the namespace `Oxide.Core'. Are you missing an assembly reference?
Has retrieving the MySql library changed too? -
Wulf Community Admin
It was never intended to have to manually reference a core DLL with // Reference, just a bug. Grabbing the library has not changed. You may want to test the latest snapshot though, as I made changes per testing with the OP of this thread. -
Using the most recent release from 13 hours ago.
-
Wulf Community Admin
Snapshot from 30+ mins ago on AppVeyor. -
Loading Oxide Core v2.0.3601...
Same issue -
Wulf Community Admin
Did you add the using statement? -
Code:
using System; using System.Collections.Generic; using Oxide.Core; //Access to Interface class using Oxide.Core.MySql; //Access to MySql Library using Oxide.Core.Database; //Access to Connection class
-
Wulf Community Admin
I can't reproduce the issue locally, could you upload your version of the plugin for me to test? -
Wulf Community Admin
Remove the //Access to MySql Library comment and it will compile.
I'll adjust the regex for stuff like that. -
But... but... how will we comment our code

[DOUBLEPOST=1508593703][/DOUBLEPOST]Compiling without issues now, thanks a bunch. -
Wulf Community Admin
I'm adjusting the regex for it, so comments on them should work soon. -
So that AppVeyor, how long before you release an update is it generally available? I wouldn't mind running a test or two pre-release to help find these pesky issues before they become a bigger problem.
-
Wulf Community Admin
Unless it's a crucial issue, then we'll generally wait until there are a few more changes or at least a game update before doing a release. -
Ahh understood. I'll check in on Thursdays and see if anything is up.
-
This line, which was changed after 2.0.3591 is the first (and only) thing that causes my problem when I use OxideMod version 2.0.3596
Code:Extensions/Oxide.CSharp/Compilation.cs
Code:var result = Regex.Replace(match.Groups[1].Value, @"Oxide\.[\w]+\.([\w]+)", "Oxide.$1");
-
Wulf Community Admin
And the problems would be what exactly? -
Same problem with original topic of this thread. At least I kind of know where to start looking. Something in the implementation of my extension is causing it to not qualify as a reference because of that line above
Code:Error while compiling: MyExtUniversal.cs(20,17): error CS0246: The type or names pace name `MyExt' could not be found. Are you missing an assembly reference?
-
Wulf Community Admin
The part you quoted is for handing adding extension references based on using statements. The code below basically looks for any "using X.X.X using statements, which then tries to find an extension by that name. If you have a varying namespace and DLL, then it may have an issue. The "Oxide." check in there is for our extensions, as we currently still have the Oxide.Core.X and Oxide.Game.X namespace, but Oxide.X for DLL names.
The only thing that has changed with that portion of code is that I removed the Oxide. specific check in the first matching line, and then added the Oxide. check later to handle our assembly name changes.Code:// Include implicit references detected from using statements in script match = Regex.Match(line, @"^\s*using\s+([\w]+\.(?:Core|Ext|Game)\.(?:[^\.]+))[^;]*;.*$", RegexOptions.IgnoreCase); if (match.Success) { var result = match.Groups[1].Value; if (result.StartsWith("Oxide.")) AddReference(plugin, Regex.Replace(result, @"Oxide\.[\w]+\.([\w]+)", "Oxide.$1")); else AddReference(plugin, result); continue; }
So, if your extension doesn't have an X.X.X namespace and assembly DLL, then that's likely the cause. I could probably loosen that up a bit as I know there are some without X.X.X.
