I can't say much about the actual code without seeing it but when you say "compile" do you mean:
Build and manually create mod zip
Use CakeBuild and grab the mod zip from the "Release" folder
Just pressing the play button in visual studio
(All of those are viable though I wouldn't recommend the first)
In regards to the mod showing up twice, this is something that commonly happens if you install the mod (by putting it in mod folder) and then run from visual studio or if you just have multiple versions of the same mod installed. Usually not an issue as it will just load the one with the latest version number.
The folder structure of the code is irrelevant btw, it's compiled into a single .DLL file. Game searches for `ModSystem` classes and uses those as entry point (assuming "type": "code" in modinfo, but that should be standard with the template) in your case the mod system would look somewhat like this:
public class MyModSystem : ModSystem
{
public override void Start(ICoreAPI api)
{
base.Start(api);
//Prevent duplicate patching in single player (because it creates 2 instances of the ModSystem, 1 for server side and 1 for client side)
if (!Harmony.HasAnyPatches(Mod.Info.ModID))
{
var harmony = new Harmony(Mod.Info.ModID);
harmony.PatchAllUncategorized();
//and possibly some category patches based on config
}
}
public override void Dispose()
{
new Harmony(Mod.Info.ModID).UnpatchAll(Mod.Info.ModID);
}
}