KSP-CKAN / CKAN

The Comprehensive Kerbal Archive Network
https://forum.kerbalspaceprogram.com/index.php?/topic/197082-*
Other
1.96k stars 349 forks source link

Could not load file or assembly System.Data or one of its dependencies #3503

Closed jeffgiffgaff closed 2 years ago

jeffgiffgaff commented 2 years ago

***I'm using Windows 10 When I attempt to open the ckan.exe (and access the GUI) which I have in my KSP directory, CMD is opened and this is printed out:

Unhandled Exception: Autofac.Core.DependencyResolutionException: An exception was thrown while activating CKAN.Configuration.JsonConfiguration. ---> Autofac.Core.DependencyResolutionException: An exception was thrown while invoking the constructor 'Void .ctor(System.String)' on type 'JsonConfiguration'. ---> System.IO.FileNotFoundException: Could not load file or assembly 'System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The system cannot find the file specified.
   at Newtonsoft.Json.Converters.BinaryConverter.CanConvert(Type objectType)
   at Newtonsoft.Json.JsonSerializer.GetMatchingConverter(IList`1 converters, Type objectType)
   at Newtonsoft.Json.Serialization.DefaultContractResolver.InitializeContract(JsonContract contract)
   at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateObjectContract(Type objectType)
   at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
   at Newtonsoft.Json.Serialization.DefaultContractResolver.ResolveContract(Type type)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize(JsonWriter jsonWriter, Object value, Type objectType)
   at Newtonsoft.Json.JsonSerializer.SerializeInternal(JsonWriter jsonWriter, Object value, Type objectType)
   at Newtonsoft.Json.JsonConvert.SerializeObjectInternal(Object value, Type type, JsonSerializer jsonSerializer)
   at CKAN.Configuration.JsonConfiguration.SaveConfig()
   at CKAN.Configuration.JsonConfiguration.Migrate()
   at CKAN.Configuration.JsonConfiguration.LoadConfig()
   at CKAN.Configuration.JsonConfiguration..ctor(String newConfig)
   at lambda_method(Closure , Object[] )
   at Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate()
   --- End of inner exception stack trace ---
   at Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate()
   at Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters)
   at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters, Object& decoratorTarget)
   --- End of inner exception stack trace ---
   at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters, Object& decoratorTarget)
   at Autofac.Core.Lifetime.LifetimeScope.GetOrCreateAndShare(Guid id, Func`1 creator)
   at Autofac.Core.Resolving.InstanceLookup.Execute()
   at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters)
   at Autofac.Core.Resolving.ResolveOperation.Execute(IComponentRegistration registration, IEnumerable`1 parameters)
   at Autofac.ResolutionExtensions.TryResolveService(IComponentContext context, Service service, IEnumerable`1 parameters, Object& instance)
   at Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable`1 parameters)
   at Autofac.ResolutionExtensions.Resolve[TService](IComponentContext context, IEnumerable`1 parameters)
   at CKAN.CmdLine.MainClass.Execute(GameInstanceManager manager, CommonOptions opts, String[] args)
   at CKAN.CmdLine.MainClass.Main(String[] args)

I've attempted to use cd (ckan.exe directory) and subsequently ckan.exe help and the help commands are listed out as such:

CKAN 1.30.4
Copyright c 2014-2020

help -
Usage: ckan help [options]

  gui          Start the CKAN GUI

  consoleui    Start the CKAN console UI

  prompt       Run CKAN prompt for executing multiple commands in a row

  search       Search for mods

  upgrade      Upgrade an installed mod

  update       Update list of available mods

  available    List available mods

  install      Install a mod

  remove       Remove an installed mod

  import       Import manually downloaded mods

  scan         Scan for manually installed mods

  list         List installed modules

  show         Show information about a mod

  clean        Clean away downloaded files from the cache

  repair       Attempt various automatic repairs

  replace      Replace list of replaceable mods

  repo         Manage CKAN repositories

  mark         Edit flags on modules

  instance     Manage game instances

  authtoken    Manage authentication tokens

  cache        Manage download cache path

  compat       Manage game version compatibility

  compare      Compare version strings

  version      Show the version of the CKAN client being used

You are using CKAN version v1.30.4

but every time I try to run one of these commands it gives me the same unhandled exception stuff. I've attempted reinstalling CKAN and KSP several times as clean as I know how but this always happens. Note that I am not at all good with coding I don't know much about this stuff so you'll have to dumb it down for me.

Thank you to anyone who can help.

DasSkelett commented 2 years ago

System.IO.FileNotFoundException: Could not load file or assembly 'System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The system cannot find the file specified.

This sounds like a issue with your .NET Framework installation. Try reinstalling it from here

jeffgiffgaff commented 2 years ago

System.IO.FileNotFoundException: Could not load file or assembly 'System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The system cannot find the file specified.

This sounds like a issue with your .NET Framework installation. Try reinstalling it from here

I downloaded and ran it but it said I had the latest version, and that I don't need an update. I've looked through all the other issues similar to mine I could find but nothing from those has worked. I'm really not quite sure what I should do.

HebaruSan commented 2 years ago

Maybe you already have a more recent version; I was able to re-install 4.8:

https://dotnet.microsoft.com/en-us/download/dotnet-framework

(My re-installation of 4.8 may have been an install rather than a re-install; I think I had the SDK stuff before: image

But either way, the point is to try to repair your install so that System.Data can be loaded.)

jeffgiffgaff commented 2 years ago

Maybe you already have a more recent version; ~I was able to re-install 4.8~:

https://dotnet.microsoft.com/en-us/download/dotnet-framework

(My re-installation of 4.8 may have been an install rather than a re-install; I think I had the SDK stuff before: image

But either way, the point is to try to repair your install so that System.Data can be loaded.)

image So both the 4.5 and 4.8 installations will just say this. Also apologies again but I'm not very technologically literate so what do you mean by the System.Data? is that a windows file or Kerbal Space program one? Is that the name for GameData on a different System? Also- I forgot to mention but I am on Windows 10.

HebaruSan commented 2 years ago

System.Data is part of the .NET Framework, the thing we're trying to help you reinstall.

Try this:

  1. Start → Programs and Features
  2. Find "Microsoft .NET Framework 4.8"
  3. Right click it and choose "Uninstall/Change" image
  4. Use the repair option: image
jeffgiffgaff commented 2 years ago

It doesn't show up when I search for it which is quite strange. I go to programs and features and search but its not there which is just very confusing when its already telling me It's installed when I try to instasll .NET? Again, thank you so much for helping though

jeffgiffgaff commented 2 years ago

does anyone know what i should do :(

HebaruSan commented 2 years ago

Keep trying to repair your .NET install. If you really can't find any way to fix it, then we're not going to be able to do much for you.

jeffgiffgaff commented 2 years ago

Keep trying to repair your .NET install. If you really can't find any way to fix it, then we're not going to be able to do much for you.

Okay thank you I understand. I've looked at some registry and it appears I don't actually have the .NET framework installed so I'm going to try and get that properly installed, and I will keep you updated if that's alright with you. Thanks again!!

jeffgiffgaff commented 2 years ago

It turns out Windows 10 doesn't show the .NET framework in the programs and features, but I've managed to find the registry and I'm pretty sure its installed. It's all very confusing. I've restored some CKAN folder I deleted a while ago when I was trying to get it to work by reinstalling but which I haven't seen until now? I'm so confused I really just want to use mods there has to be a fix. I've ran a .NET fix tool for windows 10 and it hasn't done anything I still am just getting the unhandled exception. Please help me.

jeffgiffgaff commented 2 years ago

Someone pls help me

jeffgiffgaff commented 2 years ago

According to this website, Microsoft .NET 4.0 is part of the Windows 8 Operating System, thus cannot be accessed from programs and features, subsequently making it unable to be edited or deleted. I am running on Windows 10, and by looking at regedit I can see I have .NET 4.8 installed. I don't think there's much I can do in the way of "repairing" the .NET installation from what I can tell. I very may likely be wrong as I'm not very good at this stuff. What should I do at this point? Why does my CKAN not work? Is anyone else having this issue? Please someone help I really want to play some modded ksp.

HebaruSan commented 2 years ago

No, no one else is having this issue. I suppose you could try reinstalling Windows.

jeffgiffgaff commented 2 years ago

No, no one else is having this issue. I suppose you could try reinstalling Windows.

What are the consequences of this, and is it safe?

HebaruSan commented 2 years ago

What are the consequences of this, and is it safe?

Reinstalling Windows resets your whole computer to how it was when you first got it. You would need to back up any data that you didn't want to lose to an external location. I would never say it's completely safe, but if you are completely unable to repair your .NET install, then I don't know what else you could try.

netkan-bot commented 2 years ago

Hey there! I'm a fun-loving automated bot who's responsible for making sure old support tickets get closed out. As we haven't seen any activity on this ticket for a while, we're hoping the problem has been resolved and I'm closing out the ticket automatically. If I'm doing this in error, please add a comment to this ticket to let us know, and we'll re-open it!