1. Yep, even with the current OxideMod sources, if I switch this area in Extensions/Oxide.CSharp/Compilation.cs
    Code:
    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;
    }
    
    With this
    Code:
    if (match.Success)
    {
        AddReference(plugin, match.Groups[1].Value);
        continue;
    }
    
    My extension works like before
    [DOUBLEPOST=1508651730][/DOUBLEPOST]
    I'm glad to update my stuff however is needed to make it compliant with current design. I'll press on with this new information. Thanks!
     
  2. Wulf

    Wulf Community Admin

    What do your using statements currently look like in the top of your plugin?
     
  3. Code:
    using Network;
    using System;
    using Oxide.Ext.MyExt.Libraries;
    using Oxide.Core.Libraries;
    
     
  4. Wulf

    Wulf Community Admin

    Ahh, I see why then. Didn't expect people to be using the Oxide. prefixed for their own namespace. :p
     
  5. That was just how it all started for me because originally, I copied the MySQL implementation as a framework to create my extension. The Oxide. came with it
     
  6. So here are 2 "official" 3rd-party extensions. The first seems to use the same namespace'ing as mine
    Code:
    using Oxide.Core;
    using Oxide.Core.Extensions;
    using Oxide.Core.Libraries;
    using Oxide.Core.Plugins;
    using Oxide.Ext.IRC.Libraries;
    using Oxide.Plugins;
    using System;
    using System.Collections.Generic;
    using System.Reflection;
    using System.Threading;namespace Oxide.Ext.IRC
    {
    
    But not the second example
    Code:
    using A;
    using ConVar;
    using Newtonsoft.Json.Linq;
    using Oxide.Core;
    using Oxide.Core.Extensions;
    using Oxide.Core.Logging;
    using System;
    using System.Reflection;
    using System.Runtime.CompilerServices;
    using System.Text;
    using System.Threading;namespace RustIO.Oxide
    {
    
    And I realize #2 obfuscated (lol) their effort
     
  7. GOT IT.

    The solution for me required several changes:
    1. In my extension file MyExtension.cs, I had to change:
      Code:
      namespace Oxide.Ext.MyExt
      
      to
      Code:
      namespace Ext.MyExt
      
    2. In the accompanying extension file MyExt.cs, I had to change:
      Code:
      namespace Oxide.Ext.MyExt.Libraries
      to
      Code:
      namespace Ext.MyExt.Libraries
    3. For the project properties in MSVC of MyExt.csproj, I had to change both the "Assembly name:" and "Default namespace" from:
      Code:
      Oxide.Ext.MyExt
      to
      Code:
      Ext.MyExt
    4. Then in my actual plugin MyExtUniversal.cs, I had to add to the top:
      Code:
      // Reference: Ext.MyExt
    5. And change
      Code:
      using Oxide.Ext.MyExt.Libraries;
      to
      Code:
      using Ext.MyExt.Libraries;
    Now everything works normal as it used to. My only real issue is I have this Ext.MyExt.dll file instead of Oxide.Ext.MyExt.dll in my Rust server Managed directory. It was nice before that all Oxide related stuff appeared in the same area of that directory. Oh well, that's cosmetic and of no real concern.

    I don't think this trouble of mine warrants a GitHub issue since it seems you clearly meant to make this code change to the extension reference handling code, so I won't start one. It's more of a user implementation issue.

    I am curious if the whole "// Reference: Blah.Blah.Blah" is documented somewhere? Or better yet, a brief but comprehensive description of how to properly implement an OxideMod extension?

    Thanks for your help!
     
    Last edited by a moderator: Oct 23, 2017
  8. Wulf

    Wulf Community Admin

    I'll tweak it a bit once I get a chance. The main reason for the way it is now is because we haven't changed our namespace to the new naming yet to avoid some breakage.

    The // Reference was added awhile back and never really documented, and was mainly there to reference DLLs manually added and those that aren't referenced by Oxide itself so that plugins can make use of them. We now keep default references for each game extension for common DLLs that plugins may and do use, as well as all of the core extensions.
     
  9. Wulf

    Wulf Community Admin

    Are you still having any issues on the latest builds?
     
  10. I had the same issue @Kolyma had, and I'm not seeing any issues for my extension on the latest build.
     
  11. I found a solution:

    Extension namespace:
    Code:
    namespace Ext.UI
    Plugin Reference and Using statements:
    Code:
    // Reference: Ext.UIusing Ext.UI.Libraries;
    using Ext.UI;
    Finally, I added two copies of my extension into the Oxide managed directory.
    One named Ext.UI.DLL and another named Oxide.Ext.UI.DLL


    From the research I did the issue stems from:
    Oxide/Compilation.cs at 6ffe28cd16a59c6a3ccbbb80e1ccc935d667fdd7 · OxideMod/Oxide · GitHub
    Which prevents references to any extension starting with Oxide.

    and

    Oxide/ExtensionManager.cs at 10f96237ad116e3479c8035552cfeebf0316e075 · OxideMod/Oxide · GitHub
    Which only loads extensions that DO start with Oxide.

    So by including a copy of the extension without the Oxide. the Compilation.cs file is able to reference my library while the ExtensionManager loads the dll with Oxide.
     
  12. Wulf

    Wulf Community Admin

    None of that should be necessary or needed anymore if you are fully updated. Extensions should really should be prefixed with Oxide as well in order for them to be properly handled as an extension, not a random DLL.

    To explain how Oxide currently handles it:
    • If extensions prefixed with "Oxide.", they are automatically detected and loaded at startup; manually loading them is unnecessary.
    • If "// Reference: X" is detected in a plugin, it ignores "Oxide." and a couple other DLLs that are already referenced by default in Oxide (all extensions are referenced based on using statements and default references). The select "// Reference" ignoring was added because of this, as it can cause some issues by trying to reference non-existent DLLs and conflicting dependencies.
    • If "using Oxide.*" is detected, then Oxide attempts to look and load DLLs that match that namespace if not already loaded. So by not having your extension's namespace prefixed with that, it isn't automatically loaded.
    So with that being said, if you are still having issues, you likely aren't fully updated.
     
  13. Thats just it. I am using the updated oxide and this was the only way to get my extension to reference. Using Oxide.Ext.UI would not include my assembly and the plugin that uses it could not access the extension. When I renamed it to Ext.UI it was able to reference it but the extension would not load. I could only resolve it by having both Oxide.Ext.UI and Ext.UI in the managed directory.

    This issue was compounded when I used the Oxide.* namespace. It just looped errors when I attempted to load the plugin.
     
  14. Wulf

    Wulf Community Admin

    Which version does the oxide.version command show?
     

  15. Code:
    Build Date: 10/26/2017 15:33:59
    Unity Version: 2017.1.2f1
    Changeset: 23539
    Branch: main
    Oxide Version: 2.0.3681
     
  16. I apologize if I wasn't clear, but I meant the fix that @Kolyma posted was working for me. Tried reverting my extension back to the version before the update, and still the same reference error from the plugin however the extension does load.
     
  17. Wulf

    Wulf Community Admin

    Ah... yeah, that wasn't at all clear from your last post.
     
  18. Sorry for getting your hopes up on fixing this issue lol
     
  19. Wulf

    Wulf Community Admin

    Yeah, I'll have to get some more test cases together, because the ones I've been testing do not have any issues.
     
  20. I could provide the two versions of my extension along with the using statements in my plugin if you'd like.