✅ 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 ?
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
could be that its trying to find a different 9.0.X version of System.IO.Ports
On disk it's 9.0.0.5
and the error message it search for 9.0.0.5
hold on arent the versions of these tied to the .net version?
no this is a nuget package
9.0.0.5 target net8
huh
why
isnt it in the bcl?
nope
weird
System.IO.Ports 9.0.5
Provides classes for controlling serial ports.
Commonly Used Types:
System.IO.Ports.SerialPort
it was in the bcl, in net framework
but even then afaik you should use packages that match you target framewrok version
oh, in netcore 3 it was in the bcl too

oh yeah its package provided since 8
is that because it targets standard tho
idk
still doesnt work with 8
who can we annoy with my problem :KEK:
lol probably fred
why fred
compiler team
could you check if FanControl tries to load some spcific version of System.IO.Ports
we are far from the compiler here
it's written in the error message i posted
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 ehwdym
i meant maybe FanControl itself loads version 9.0.0.1 and your lib wants 9.0.0.5 or something
i have a debugger plugged in and there isn't any other module of System.IO.Ports loaded
no idea then
...
it started working
idk how
lmao
well good