Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Cannot Load the Console UI #3871

Closed
1 task done
erkinalp opened this issue Jul 28, 2023 · 7 comments · Fixed by #3872
Closed
1 task done

[Bug]: Cannot Load the Console UI #3871

erkinalp opened this issue Jul 28, 2023 · 7 comments · Fixed by #3872
Labels
Build Issues affecting the build system Linux Issues specific for Linux Mono Issues specific for Mono Package: deb Issues affecting the Debian packaging

Comments

@erkinalp
Copy link

erkinalp commented Jul 28, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Operating System

Ubuntu 22.04

CKAN Version

1.33.2

Game Version

irrelevant

Did you make any manual changes to your game folder (i.e., not via CKAN)?

no

Describe the bug

CKAN console UI failed to start, instead raised a .NET exception.

Steps to reproduce

Type ckan consoleui on the command line.

Relevant log output

System.TypeLoadException: Could not load type of field 'CKAN.ConsoleUI.Toolkit.ConsoleTextBox:lines' (5) due to: Could not load file or assembly 'System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies.
  at CKAN.ConsoleUI.GameInstanceListScreen.TryGetInstance (CKAN.ConsoleUI.Toolkit.ConsoleTheme theme, CKAN.GameInstance ksp, System.Action`1[T] render) [0x00038] in <1415add505c24fcdaa2e24ead75d4099>:0 
  at CKAN.ConsoleUI.SplashScreen.Run (CKAN.ConsoleUI.Toolkit.ConsoleTheme theme) [0x0001e] in <1415add505c24fcdaa2e24ead75d4099>:0 
  at CKAN.ConsoleUI.ConsoleCKAN..ctor (CKAN.GameInstanceManager mgr, System.String themeName, System.Boolean debug) [0x00035] in <1415add505c24fcdaa2e24ead75d4099>:0 
  at CKAN.ConsoleUI.ConsoleUI.Main_ (System.String[] args, CKAN.GameInstanceManager manager, System.String themeName, System.Boolean debug) [0x00005] in <1415add505c24fcdaa2e24ead75d4099>:0 
  at CKAN.CmdLine.MainClass.ConsoleUi (CKAN.GameInstanceManager manager, CKAN.CmdLine.ConsoleUIOptions opts, System.String[] args) [0x00034] in <1415add505c24fcdaa2e24ead75d4099>:0 
  at CKAN.CmdLine.MainClass.RunSimpleAction (CKAN.CmdLine.Options cmdline, CKAN.CmdLine.CommonOptions options, System.String[] args, CKAN.IUser user, CKAN.GameInstanceManager manager) [0x002df] in <1415add505c24fcdaa2e24ead75d4099>:0 
  at CKAN.CmdLine.MainClass.Execute (CKAN.GameInstanceManager manager, CKAN.CmdLine.CommonOptions opts, System.String[] args) [0x00296] in <1415add505c24fcdaa2e24ead75d4099>:0 
  at CKAN.CmdLine.MainClass.Main (System.String[] args) [0x000e9] in <1415add505c24fcdaa2e24ead75d4099>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeLoadException: Could not load type of field 'CKAN.ConsoleUI.Toolkit.ConsoleTextBox:lines' (5) due to: Could not load file or assembly 'System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies.
  at CKAN.ConsoleUI.GameInstanceListScreen.TryGetInstance (CKAN.ConsoleUI.Toolkit.ConsoleTheme theme, CKAN.GameInstance ksp, System.Action`1[T] render) [0x00038] in <1415add505c24fcdaa2e24ead75d4099>:0 
  at CKAN.ConsoleUI.SplashScreen.Run (CKAN.ConsoleUI.Toolkit.ConsoleTheme theme) [0x0001e] in <1415add505c24fcdaa2e24ead75d4099>:0 
  at CKAN.ConsoleUI.ConsoleCKAN..ctor (CKAN.GameInstanceManager mgr, System.String themeName, System.Boolean debug) [0x00035] in <1415add505c24fcdaa2e24ead75d4099>:0 
  at CKAN.ConsoleUI.ConsoleUI.Main_ (System.String[] args, CKAN.GameInstanceManager manager, System.String themeName, System.Boolean debug) [0x00005] in <1415add505c24fcdaa2e24ead75d4099>:0 
  at CKAN.CmdLine.MainClass.ConsoleUi (CKAN.GameInstanceManager manager, CKAN.CmdLine.ConsoleUIOptions opts, System.String[] args) [0x00034] in <1415add505c24fcdaa2e24ead75d4099>:0 
  at CKAN.CmdLine.MainClass.RunSimpleAction (CKAN.CmdLine.Options cmdline, CKAN.CmdLine.CommonOptions options, System.String[] args, CKAN.IUser user, CKAN.GameInstanceManager manager) [0x002df] in <1415add505c24fcdaa2e24ead75d4099>:0 
  at CKAN.CmdLine.MainClass.Execute (CKAN.GameInstanceManager manager, CKAN.CmdLine.CommonOptions opts, System.String[] args) [0x00296] in <1415add505c24fcdaa2e24ead75d4099>:0 
  at CKAN.CmdLine.MainClass.Main (System.String[] args) [0x000e9] in <1415add505c24fcdaa2e24ead75d4099>:0
@erkinalp erkinalp changed the title [Bug]: Cannot Load [Bug]: Cannot Load the Console UI Jul 28, 2023
@HebaruSan HebaruSan added Support Issues that are support requests Mono Issues specific for Mono labels Jul 28, 2023
@HebaruSan
Copy link
Member

Pasting the inner error for easier browsing:

Could not load file or assembly 'System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies.

@erkinalp, this looks like a problem with your Mono install. I just tried this in Ubuntu and there was no error.

@HebaruSan
Copy link
Member

A web search for this error turns up some references to people attempting to make .NET Core code talk to .NET Framework. If that's happening here, it's probably not going to work; install Mono:

https://github.com/KSP-CKAN/CKAN/wiki/Installing-CKAN-on-Ubuntu

@erkinalp
Copy link
Author

This is with what CKAN automatically pulled as its dependencies. Works perfectly if I manually install mono-complete.

@HebaruSan
Copy link
Member

HebaruSan commented Jul 28, 2023

Ahh, so maybe the .deb dependencies need to be updated (mono-complete is unfortunately not allowed here):

Depends: mono-runtime (>=5.0), ca-certificates-mono, libmono-microsoft-csharp4.0-cil, liblog4net1.2-cil, libnewtonsoft-json5.0-cil, libmono-system-net-http-webrequest4.0-cil

Can you report whether installing libmono-system-servicemodel4.0a-cil fixes it?

@HebaruSan HebaruSan added Build Issues affecting the build system Linux Issues specific for Linux Package: deb Issues affecting the Debian packaging and removed Support Issues that are support requests labels Jul 28, 2023
@HebaruSan
Copy link
Member

OK, on my Ubuntu, I removed mono-complete and as many other Mono packages as apt would let me with ckan installed, and I still have libmono-system-servicemodel-internals0.0-cil installed (and consoleui is still working). If I try removing that, apt attempts to remove ckan, suggesting an indirect dependency is already in place:

$ sudo apt remove libmono-system-servicemodel-internals0.0-cil 
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  liblog4net1.2-cil libmono-accessibility4.0-cil libmono-ldap4.0-cil libmono-microsoft-csharp4.0-cil libmono-sqlite4.0-cil
  libmono-system-componentmodel-dataannotations4.0-cil libmono-system-data4.0-cil libmono-system-design4.0-cil
  libmono-system-enterpriseservices4.0-cil libmono-system-ldap4.0-cil libmono-system-net-http-webrequest4.0-cil
  libmono-system-net-http4.0-cil libmono-system-runtime-serialization-formatters-soap4.0-cil libmono-system-transactions4.0-cil
  libmono-system-web-applicationservices4.0-cil libmono-system-web-services4.0-cil libmono-system-web4.0-cil
  libmono-system-windows-forms4.0-cil libmono-system-xml-linq4.0-cil libmono-webbrowser4.0-cil
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  ckan libmono-system-runtime-serialization4.0-cil libmono-system-servicemodel-internals0.0-cil libnewtonsoft-json5.0-cil

@HebaruSan
Copy link
Member

HebaruSan commented Jul 28, 2023

Update, pressing ctrl-R to refresh the mod list now throws the same System.TypeLoadException, so I can experiment with installing more dependencies...

... confirmed, sudo apt install libmono-system-servicemodel4.0a-cil fixed it.

@HebaruSan
Copy link
Member

@erkinalp, thanks for the report and for reviewing the fix pull request!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build Issues affecting the build system Linux Issues specific for Linux Mono Issues specific for Mono Package: deb Issues affecting the Debian packaging
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants