Hello, I need your help with installing VNc. We were using it on Windows without any issues, but we encountered a problem when transitioning to Linux Ubuntu. I hope to receive your support in resolving this problem.


Error::
Error:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: The type initializer for 'VitaNex.Text.UOFont' threw an exception. ---> System.NotImplementedException: The requested feature is not implemented [GDI+ status: NotImplemented]
  at System.Drawing.GDIPlus.CheckStatus (System.Drawing.Status status) [0x00190] in <3403ef0f91dd4bb1a52eecc5c4cc7a76>:0
  at System.Drawing.Bitmap..ctor (System.Int32 width, System.Int32 height, System.Drawing.Imaging.PixelFormat format) [0x00016] in <3403ef0f91dd4bb1a52eecc5c4cc7a76>:0
  at (wrapper remoting-invoke-with-check) System.Drawing.Bitmap..ctor(int,int,System.Drawing.Imaging.PixelFormat)
  at VitaNex.Text.UOFonts.NewEmptyImage () [0x00000] in /opt/ServUO-Pub5722/Scripts/VitaNex/Core/Text/UOFont.cs:75
  at VitaNex.Text.UOFonts.NewEmptyChar (VitaNex.Text.UOEncoding enc) [0x00000] in /opt/ServUO-Pub5722/Scripts/VitaNex/Core/Text/UOFont.cs:80
  at VitaNex.Text.UOFonts.LoadUnicode (System.Byte id) [0x00110] in /opt/ServUO-Pub5722/Scripts/VitaNex/Core/Text/UOFont.cs:214
  at VitaNex.Text.UOFonts.GetFont (VitaNex.Text.UOEncoding enc, System.Byte id) [0x00010] in /opt/ServUO-Pub5722/Scripts/VitaNex/Core/Text/UOFont.cs:322
  at VitaNex.Text.UOFonts.get_Item (System.Int32 id) [0x00000] in /opt/ServUO-Pub5722/Scripts/VitaNex/Core/Text/UOFont.cs:345
  at VitaNex.Text.UOFont..cctor () [0x00027] in /opt/ServUO-Pub5722/Scripts/VitaNex/Core/Text/UOFont.cs:463
   --- End of inner exception stack trace ---
  at (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.InternalInvoke(System.Reflection.RuntimeMethodInfo,object,object[],System.Exception&)
  at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0006a] in <de882a77e7c14f8ba5d298093dde82b2>:0
   --- End of inner exception stack trace ---
  at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00083] in <de882a77e7c14f8ba5d298093dde82b2>:0
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <de882a77e7c14f8ba5d298093dde82b2>:0
  at Server.ScriptCompiler.Invoke (System.String method) [0x00071] in /opt/ServUO-Pub5722/Server/ScriptCompiler.cs:530
  at Server.Core.Main (System.String[] args) [0x005d7] in /opt/ServUO-Pub5722/Server/Main.cs:664
This exception is fatal, press return to exit
 
Try:

C#:
sudo apt-get install -y libgdiplus

I've been running one of my p58 dev servers, including VNC on Ubuntu so hopefully that will fix it for you.
 
Try:

C#:
sudo apt-get install -y libgdiplus

I've been running one of my p58 dev servers, including VNC on Ubuntu so hopefully that will fix it for you.
I have already tried installing the package(


install:
sudo apt-get install -y libgdiplus
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libgdiplus is already the newest version (6.0.5-0xamarin1+ubuntu2004b1).
0 upgraded, 0 newly installed, 0 to remove and 111 not upgraded.

Could the reason be the version of Mono?

mono:
mono --version
Mono JIT compiler version 6.12.0.182 (tarball Tue Jun 14 22:35:00 UTC 2022)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
 
Last edited:
Hmmm same mono version as me, so not sure why you're still having that issue.

Do something like this and see if for whatever reason you have multiple that may be causing conflicts. Double check it's in /usr/lib/ - if not you may need to do a symlink to wherever it got installed.
C#:
sudo find / -name "libgdiplus.so"

All else failing try following the mono docs here. Hopefully, that helps because VNC definitely works on mono

vortex.PNG
 
If the unix wrapper hasn't added support for 16-bit image formats to gdi+ yet (it wasn't supported in mono afaik) then you can try changing the pixel format to 32-bit to avoid the error, but the UOFont may not work as intended (it will be obvious on things like MenuGump where it measures string widths to determine gump width).

I will work out an alternative as I did when writing the asset handlers for the ServUO core, if the data is read in its raw format, and converted to 32-bit, then loaded into the image, it will work.
 
Hmmm same mono version as me, so not sure why you're still having that issue.

Do something like this and see if for whatever reason you have multiple that may be causing conflicts. Double check it's in /usr/lib/ - if not you may need to do a symlink to wherever it got installed.
C#:
sudo find / -name "libgdiplus.so"

All else failing try following the mono docs here. Hopefully, that helps because VNC definitely works on mono

View attachment 21951


I found two files that might cause a conflict. Should I delete the one located... /usr/local/lib/libgdiplus.so ?


libgdiplus.so:
sudo find / -name "libgdiplus.so"
/usr/local/lib/libgdiplus.so
/usr/lib/libgdiplus.so
find: ‘/run/user/1000/doc’: Permission denied
find: ‘/run/user/1000/gvfs’: Permission denied
If the unix wrapper hasn't added support for 16-bit image formats to gdi+ yet (it wasn't supported in mono afaik) then you can try changing the pixel format to 32-bit to avoid the error, but the UOFont may not work as intended (it will be obvious on things like MenuGump where it measures string widths to determine gump width).

I will work out an alternative as I did when writing the asset handlers for the ServUO core, if the data is read in its raw format, and converted to 32-bit, then loaded into the image, it will work.

I changed the value from 16 to 32 when starting the server and encountered one error. However, the server started successfully. But it seems that the system is not functioning properly for me, as the VNC command is not recognized.

I was mistaken, the server did not start.

public const PF PixelFormat = PF.Format32bppArgb1555;

UOFont:
/opt/ServUO-TEST/ServUO-Pub57/Scripts/VitaNex/Core/Text/UOFont.cs(448,36): error CS0117: 'PixelFormat' does not contain a definition for 'Format32bppArgb1555' [/opt/ServUO-TEST/ServUO-Pub57/Scripts/Scripts.csproj]

compile sripts.dll

UOFont:
    public sealed class UOFont
    {
#if MONO
        public const PF PixelFormat = PF.Format32bppArgb;
#else
        public const PF PixelFormat = PF.Format32bppArgb;
#endif

        public static Size DefaultCharSize = new Size(8, 10);

        public static UOFonts Ascii { get; private set; }
        public static UOFonts Unicode { get; private set; }

        static UOFont()
        {
            Ascii = new UOFonts(UOEncoding.Ascii);
            Unicode = new UOFonts(UOEncoding.Unicode);

            for (var i = 0; i <= 1; i++)
            {
                VitaNexCore.ToConsole("[UOFont]: Preloaded {0}", Unicode[i]);
            }
        }


VitaNexCore:
[VitaNexCore]: [UOFont]: Preloaded (Unicode, 0, 65536)
[VitaNexCore]: [UOFont]: Preloaded (Unicode, 1, 65536)

                                                                                                                                                                                        **** VITA-NEX: CORE 5.3.1.0 ****                                                                                                        Error:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object
  at VitaNex.VitaNexCore.DisplayRetroBoot () [0x00081] in /opt/ServUO-TEST/ServUO-Pub57/Scripts/VitaNex/Core/VitaNex.cs:917
  at VitaNex.VitaNexCore.Configure () [0x00008] in /opt/ServUO-TEST/ServUO-Pub57/Scripts/VitaNex/Core/VitaNex.cs:212
  at (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.InternalInvoke(System.Reflection.RuntimeMethodInfo,object,object[],System.Exception&)
  at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0006a] in <de882a77e7c14f8ba5d298093dde82b2>:0
   --- End of inner exception stack trace ---
  at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00083] in <de882a77e7c14f8ba5d298093dde82b2>:0
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <de882a77e7c14f8ba5d298093dde82b2>:0
  at Server.ScriptCompiler.Invoke (System.String method) [0x00071] in /opt/ServUO-TEST/ServUO-Pub57/Server/ScriptCompiler.cs:530
  at Server.Core.Main (System.String[] args) [0x005d7] in /opt/ServUO-TEST/ServUO-Pub57/Server/Main.cs:664
This exception is fatal, press return to exit

After reinstalling both Mono, .NET, and libgdiplus, when running the source file UOFont.cs with 16-bit, no errors were encountered until the compilation stage.

ldconfig:
ldconfig -p | grep libgdiplus
    libgdiplus.so.0 (libc6,x86-64) => /usr/lib/libgdiplus.so.0
    libgdiplus.so (libc6,x86-64) => /usr/lib/libgdiplus.so


Error:
Error:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: The type initializer for 'VitaNex.Text.UOFont' threw an exception. ---> System.NotImplementedException: The requested feature is not implemented [GDI+ status: NotImplemented]
  at System.Drawing.GDIPlus.CheckStatus (System.Drawing.Status status) [0x00190] in <3403ef0f91dd4bb1a52eecc5c4cc7a76>:0
  at System.Drawing.Bitmap..ctor (System.Int32 width, System.Int32 height, System.Drawing.Imaging.PixelFormat format) [0x00016] in <3403ef0f91dd4bb1a52eecc5c4cc7a76>:0
  at (wrapper remoting-invoke-with-check) System.Drawing.Bitmap..ctor(int,int,System.Drawing.Imaging.PixelFormat)
  at VitaNex.Text.UOFonts.NewEmptyImage () [0x00000] in /opt/ServUO-TEST/ServUO-Pub57/Scripts/VitaNex/Core/Text/UOFont.cs:75
  at VitaNex.Text.UOFonts.NewEmptyChar (VitaNex.Text.UOEncoding enc) [0x00000] in /opt/ServUO-TEST/ServUO-Pub57/Scripts/VitaNex/Core/Text/UOFont.cs:80
  at VitaNex.Text.UOFonts.LoadUnicode (System.Byte id) [0x00110] in /opt/ServUO-TEST/ServUO-Pub57/Scripts/VitaNex/Core/Text/UOFont.cs:214
  at VitaNex.Text.UOFonts.GetFont (VitaNex.Text.UOEncoding enc, System.Byte id) [0x00010] in /opt/ServUO-TEST/ServUO-Pub57/Scripts/VitaNex/Core/Text/UOFont.cs:322
  at VitaNex.Text.UOFonts.get_Item (System.Int32 id) [0x00000] in /opt/ServUO-TEST/ServUO-Pub57/Scripts/VitaNex/Core/Text/UOFont.cs:345
  at VitaNex.Text.UOFont..cctor () [0x00027] in /opt/ServUO-TEST/ServUO-Pub57/Scripts/VitaNex/Core/Text/UOFont.cs:463
   --- End of inner exception stack trace ---
  at (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.InternalInvoke(System.Reflection.RuntimeMethodInfo,object,object[],System.Exception&)
  at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0006a] in <de882a77e7c14f8ba5d298093dde82b2>:0
   --- End of inner exception stack trace ---
  at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00083] in <de882a77e7c14f8ba5d298093dde82b2>:0
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <de882a77e7c14f8ba5d298093dde82b2>:0
  at Server.ScriptCompiler.Invoke (System.String method) [0x00071] in /opt/ServUO-TEST/ServUO-Pub57/Server/ScriptCompiler.cs:530
  at Server.Core.Main (System.String[] args) [0x005d7] in /opt/ServUO-TEST/ServUO-Pub57/Server/Main.cs:664
This exception is fatal, press return to exit
 
Last edited:
In MONO libgdiplus, System.Drawing.Bitmap() does not impletemted.
the source code(mono/mcs/class/System.Drawing/System.Drawing/Bitmap.cs) said:
public sealed partial class Bitmap : System.Drawing.Image
{
....
public Bitmap(int width, int height, System.Drawing.Imaging.PixelFormat format) => throw new PlatformNotSupportedException();
....
}
For using MONO, UOFonts.cs needs more hard works. but i can not do it.
 
Back