T321

Initiate
Greetings,

Trying to get this to work on Ubuntu and recive the following error.

Errors:
+ VitaNex/Core/PropertyObjects/SettingsObject.cs:
CS0450: Line 22: `System.Enum': cannot specify both a constraint class and the `class' or `struct' constraint
CS0702: Line 22: A constraint cannot be special class `System.Enum'
+ VitaNex/Core/Extensions/Server/SerializeExt.cs:
CS0450: Line 1593: `System.Enum': cannot specify both a constraint class and the `class' or `struct' constraint
CS0702: Line 1593: A constraint cannot be special class `System.Enum'
CS0450: Line 1657: `System.Enum': cannot specify both a constraint class and the `class' or `struct' constraint
CS0702: Line 1657: A constraint cannot be special class `System.Enum'
CS0450: Line 1675: `System.Enum': cannot specify both a constraint class and the `class' or `struct' constraint
CS0702: Line 1675: A constraint cannot be special class `System.Enum'

I did change the ScriptCompiler to use langversion:7.2 instead of 7.3 as that was the only way for me to get ServUO to actually run. Hopefully that is not causing the issue...

Any pointers would help. Thanks!
 
You can probably just remove the "Enum" part of the constraint, for example;
Code:
where T : struct, Enum
->
Code:
where T : struct
 
Making those changes it still runs on Windows but on Linux it is throwing a few errors. I'm not even sure if these errors are related or not but...one such error:

ScriptCompiler: : Unhandled Exception:
ScriptCompiler: : Mono.CSharp.InternalErrorException: Scripts/VitaNex/Core/Modules/EquipmentSets/Objects/Set.cs(150,53): VitaNex.Modules.EquipmentSets.EquipmentSet.FindEquippedParts(Server.Mobile) ---> Mono.CSharp.InternalErrorException: (1,1): ---> Mono.CSharp.InternalErrorException: Scripts/VitaNex/Core/Modules/EquipmentSets/Objects/Set.cs(151,3): VitaNex.Modules.EquipmentSets.EquipmentSet.<FindEquippedParts>c__Iterator0.<item>__2 ---> System.NullReferenceException: Object reference not set to an instance of an object
ScriptCompiler: : at IKVM.Reflection.Signature.WriteType (IKVM.Reflection.Emit.ModuleBuilder module, IKVM.Reflection.Writer.ByteBuffer bb, IKVM.Reflection.Type type) [0x000b6] in <8af43adb329b4b31adfd72b11b31e258>:0
ScriptCompiler: : at IKVM.Reflection.FieldSignature.WriteSig (IKVM.Reflection.Emit.ModuleBuilder module, IKVM.Reflection.Writer.ByteBuffer bb) [0x00014] in <8af43adb329b4b31adfd72b11b31e258>:0
ScriptCompiler: : at IKVM.Reflection.Emit.FieldBuilder..ctor (IKVM.Reflection.Emit.TypeBuilder type, System.String name, IKVM.Reflection.Type fieldType, IKVM.Reflection.CustomModifiers customModifiers, IKVM.Reflection.FieldAttributes attribs) [0x00062] in <8af43adb329b4b31adfd72b11b31e258>:0
ScriptCompiler: : at IKVM.Reflection.Emit.TypeBuilder.__DefineField (System.String fieldName, IKVM.Reflection.Type type, IKVM.Reflection.CustomModifiers customModifiers, IKVM.Reflection.FieldAttributes attributes) [0x00000] in <8af43adb329b4b31adfd72b11b31e258>:0
ScriptCompiler: : at IKVM.Reflection.Emit.TypeBuilder.DefineField (System.String fieldName, IKVM.Reflection.Type type, IKVM.Reflection.Type[] requiredCustomModifiers, IKVM.Reflection.Type[] optionalCustomModifiers, IKVM.Reflection.FieldAttributes attributes) [0x0000b] in <8af43adb329b4b31adfd72b11b31e258>:0
ScriptCompiler: : at Mono.CSharp.Field.Define () [0x00076] in <8af43adb329b4b31adfd72b11b31e258>:0
ScriptCompiler: : at Mono.CSharp.TypeDefinition.DoDefineMembers () [0x0033a] in <8af43adb329b4b31adfd72b11b31e258>:0
ScriptCompiler: : --- End of inner exception stack trace ---
 
Sorry, I'm not even sure where to begin with that, MONO is fickle at the best of times and the code throwing the null-reference error doesn't have the potential to actually be null.

Is it the latest version of MONO?
 
I was on 6.8.0.105 but just updated to the latest of 6.12.0.200. Still hitting that same error.

I shall continue to beat my head against the wall and see what happens :).
 
install latest version of mono with: sudo apt install mono-develop[
that will install everything related to mono.

update your gcc compiler, that might be a problem.

and beyond that, not sure.
 
I have installed the monodevelop and verified newest version of gcc. Sadly the same issue occurs.

Back to
frustrated head GIF
 
I'm using mono 6.13.0. and i'd deleted 'struct' keywords.
but I got following errors.
Errors:
+ VitaNex/Core/PropertyObjects/SettingsObject.cs:
CS0702: Line 22: A constraint cannot be special class `System.Enum'
+ VitaNex/Core/Extensions/Server/SerializeExt.cs:
CS0702: Line 1593: A constraint cannot be special class `System.Enum'
CS0702: Line 1657: A constraint cannot be special class `System.Enum'
CS0702: Line 1675: A constraint cannot be special class `System.Enum'
Scripts: One or more scripts failed to compile or no script files were found.
MONO supports only "/langversion:7.2", not "/langversion:7.3".
So it can not compile following code:
void Func<T>() where T: System.Enum {}
Help!

I tried to compile Vita-Nex 5.2.0. I didn't get above errors.
but I got errors in UOFonts.cs (https://www.servuo.com/threads/compilation-error-in-uofont-cs.15461/#post-91764)
I think we cannot compile Vita-Nex in MONO environments(Ubuntu/macOS)o_O
 
Last edited:
Making those changes it still runs on Windows but on Linux it is throwing a few errors. I'm not even sure if these errors are related or not but...one such error:

ScriptCompiler: : Unhandled Exception:
ScriptCompiler: : Mono.CSharp.InternalErrorException: Scripts/VitaNex/Core/Modules/EquipmentSets/Objects/Set.cs(150,53): VitaNex.Modules.EquipmentSets.EquipmentSet.FindEquippedParts(Server.Mobile) ---> Mono.CSharp.InternalErrorException: (1,1): ---> Mono.CSharp.InternalErrorException: Scripts/VitaNex/Core/Modules/EquipmentSets/Objects/Set.cs(151,3): VitaNex.Modules.EquipmentSets.EquipmentSet.<FindEquippedParts>c__Iterator0.<item>__2 ---> System.NullReferenceException: Object reference not set to an instance of an object
ScriptCompiler: : at IKVM.Reflection.Signature.WriteType (IKVM.Reflection.Emit.ModuleBuilder module, IKVM.Reflection.Writer.ByteBuffer bb, IKVM.Reflection.Type type) [0x000b6] in <8af43adb329b4b31adfd72b11b31e258>:0
ScriptCompiler: : at IKVM.Reflection.FieldSignature.WriteSig (IKVM.Reflection.Emit.ModuleBuilder module, IKVM.Reflection.Writer.ByteBuffer bb) [0x00014] in <8af43adb329b4b31adfd72b11b31e258>:0
ScriptCompiler: : at IKVM.Reflection.Emit.FieldBuilder..ctor (IKVM.Reflection.Emit.TypeBuilder type, System.String name, IKVM.Reflection.Type fieldType, IKVM.Reflection.CustomModifiers customModifiers, IKVM.Reflection.FieldAttributes attribs) [0x00062] in <8af43adb329b4b31adfd72b11b31e258>:0
ScriptCompiler: : at IKVM.Reflection.Emit.TypeBuilder.__DefineField (System.String fieldName, IKVM.Reflection.Type type, IKVM.Reflection.CustomModifiers customModifiers, IKVM.Reflection.FieldAttributes attributes) [0x00000] in <8af43adb329b4b31adfd72b11b31e258>:0
ScriptCompiler: : at IKVM.Reflection.Emit.TypeBuilder.DefineField (System.String fieldName, IKVM.Reflection.Type type, IKVM.Reflection.Type[] requiredCustomModifiers, IKVM.Reflection.Type[] optionalCustomModifiers, IKVM.Reflection.FieldAttributes attributes) [0x0000b] in <8af43adb329b4b31adfd72b11b31e258>:0
ScriptCompiler: : at Mono.CSharp.Field.Define () [0x00076] in <8af43adb329b4b31adfd72b11b31e258>:0
ScriptCompiler: : at Mono.CSharp.TypeDefinition.DoDefineMembers () [0x0033a] in <8af43adb329b4b31adfd72b11b31e258>:0
ScriptCompiler: : --- End of inner exception stack trace ---
I don't know why but the yield return is causing the exception. Here are all the changes I had to make in order to get script compilation working under Mono.

Get script compilation working under Mono · cgreen/Shards_of_Minax@a9ab78f
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back