Hi guys. I have some problems with Rust extension creation. So... for example i have very simple code:
When i trying use delegate feature, I get ReflectionTypeLoadExceptionCode:using System;using Oxide.Core; using Oxide.Core.Extensions;namespace Oxide.Ext.SimpleExt { public class SimpleExt: Extension { public override string Name { get { return "ExtName"; } } public override VersionNumber Version { get { return new VersionNumber(1, 0, 0); } } public override string Author { get { return "Ext Team"; } } public SimpleExt(ExtensionManager manager) : base(manager) { // This make ReflectionTypeLoadException :( Action<int, int> t = delegate(int i, int j) { }; } } }
I'm using Visual Studio 2010 (.NET 4.0). I will be glad for your helpCode:ReflectionTypeLoadException: The classes in the module cannot be loaded. at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (bool) at System.Reflection.Assembly.GetTypes () [0x00000] in <filename unknown>:0 at Network.Serialize.<Initialize>m__56 (System.Reflection.Assembly x) [0x00000] in <filename unknown>:0 at System.Linq.Enumerable+<CreateSelectManyIterator>c__Iterator12`2[System.Reflection.Assembly,System.Type].MoveNext () [0x00000] in <filename unknown>:0 at System.Linq.Enumerable+<CreateWhereIterator>c__Iterator1D`1[System.Type].MoveNext () [0x00000] in <filename unknown>:0 at System.Linq.Enumerable+<CreateWhereIterator>c__Iterator1D`1[System.Type].MoveNext () [0x00000] in <filename unknown>:0 at Network.Serialize.Initialize () [0x00000] in <filename unknown>:0 at Bootstrap.NetworkInit () [0x00000] in <filename unknown>:0 at Bootstrap.Init_Tier0 () [0x00000] in <filename unknown>:0 at Bootstrap+<Start>c__Iterator2.MoveNext () [0x00000] in <filename unknown>:0![]()
ReflectionTypeLoadException when using delegate feature
Discussion in 'Rust Development' started by Andrew Mensky, Aug 15, 2015.
-
Is your project targeting .Net 3.5 ? And have you tried using lambda instead of delegate?
Code:Action<int, int> t = (i, j) => {}; -
Nope, .Net 4.0
-
Wulf Community Admin
.NET 3.5 is what should be targeted, as that's what Unity supports. -
Thx
