C
C#3w ago
Kuinox

✅ DLL Loading issues in a plugin

Hello there, I'm writing a plugin for FanControl.
It need to read a serial port so I depends on System.IO.Ports.
Sadly when it try to run the code that use the library, I hit: Could not load file or assembly 'System.IO.Ports, Version=9.0.0.5, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The located assembly's manifest definition does not match the assembly reference. (0x80131040)":"System.IO.Ports, Version=9.0.0.5, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51 Both FanControl, and my dll target .NET 8 What is the problem here ?
25 Replies
sibber
sibber3w ago
could be that its trying to find a different 9.0.X version of System.IO.Ports
Kuinox
KuinoxOP3w ago
On disk it's 9.0.0.5 and the error message it search for 9.0.0.5
sibber
sibber3w ago
hold on arent the versions of these tied to the .net version?
Kuinox
KuinoxOP3w ago
no this is a nuget package 9.0.0.5 target net8
sibber
sibber3w ago
huh why isnt it in the bcl?
Kuinox
KuinoxOP3w ago
nope
sibber
sibber3w ago
weird
Kuinox
KuinoxOP3w ago
System.IO.Ports 9.0.5
Provides classes for controlling serial ports. Commonly Used Types: System.IO.Ports.SerialPort
Kuinox
KuinoxOP3w ago
it was in the bcl, in net framework
sibber
sibber3w ago
but even then afaik you should use packages that match you target framewrok version
Kuinox
KuinoxOP3w ago
oh, in netcore 3 it was in the bcl too
Kuinox
KuinoxOP3w ago
No description
sibber
sibber3w ago
oh yeah its package provided since 8 is that because it targets standard tho idk
Kuinox
KuinoxOP3w ago
still doesnt work with 8 who can we annoy with my problem :KEK:
sibber
sibber3w ago
lol probably fred
Kuinox
KuinoxOP3w ago
why fred
sibber
sibber3w ago
compiler team could you check if FanControl tries to load some spcific version of System.IO.Ports
Kuinox
KuinoxOP3w ago
we are far from the compiler here it's written in the error message i posted
sibber
sibber3w ago
but thats what your lib is targeting like try not targeting it and using AppDomain.CurrentDomain.GetAssemblies() and see if its there long shot but eh
Kuinox
KuinoxOP3w ago
wdym
sibber
sibber3w ago
i meant maybe FanControl itself loads version 9.0.0.1 and your lib wants 9.0.0.5 or something
Kuinox
KuinoxOP3w ago
i have a debugger plugged in and there isn't any other module of System.IO.Ports loaded
sibber
sibber3w ago
no idea then
Kuinox
KuinoxOP3w ago
... it started working idk how
sibber
sibber3w ago
lmao well good

Did you find this page helpful?