Solved C# XML.Linq

hunternope3

Plugin Developer
Plugin Developer
Mar 22, 2015
36
46
8
36
I recently started writing a plugin for fougerite in C#.
I wanted to store my data in a XML file. Compling the plugin and running it on the server without defining a Xml.Linq component works. But as soon as i define a simple XDocument property or normal field:

Untitled.png

I recieve the following error on my dedicated server console (while loading plugin).

error.png

Does Rust/fougerite support XML.Linq?
 

hunternope3

Plugin Developer
Plugin Developer
Mar 22, 2015
36
46
8
36
C#:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Fougerite;
using System.Xml.Linq;
namespace test
{
    public class Test : Fougerite.Module
    {
        public XDocument Document = null;

        public override void Initialize() { }

        public override void DeInitialize() { }
    }
}
This simple class throws the exception aswell.

using system.XML components are working.
using system.XML.Linq components throws a exception during plugin loading.
 

Snake

Moderator
Moderator
Jul 13, 2014
288
174
28
C#:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Fougerite;
using System.Xml.Linq;
namespace test
{
    public class Test : Fougerite.Module
    {
        public XDocument Document = null;

        public override void Initialize() { }

        public override void DeInitialize() { }
    }
}
This simple class throws the exception aswell.

using system.XML components are working.
using system.XML.Linq components throws a exception during plugin loading.

Let me see if it also throws exception on my server.
 

Snake

Moderator
Moderator
Jul 13, 2014
288
174
28
I was thinking that this might be a Mono compatibility issue. In Unity, there are problems if you import assemblies that aren't designed for Mono.

For example MySQL .NET connect doesn't work well with Mono.
 
  • Informative
Reactions: DreTaX

hunternope3

Plugin Developer
Plugin Developer
Mar 22, 2015
36
46
8
36
Solved the issue.

add the microsoft dll: System.Xml.Linq.dll to the servers manged folder.
(Legacy\rust_server_Data\Managed).
 
  • Informative
Reactions: DreTaX

Snake

Moderator
Moderator
Jul 13, 2014
288
174
28
missing references as in missing dll or no using System.Xml.Linq ?
Missing the dll. When I tested this, I copied the DLL to the Module folder of the plugin. Didn't think about copying it on the Managed folder.