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

"Could not load file or assembly Mono.Posix" in .NET 4.8 project #15

Closed
steingran opened this issue Jan 3, 2020 · 3 comments · Fixed by #16
Closed

"Could not load file or assembly Mono.Posix" in .NET 4.8 project #15

steingran opened this issue Jan 3, 2020 · 3 comments · Fixed by #16
Labels
bug Something isn't working

Comments

@steingran
Copy link

steingran commented Jan 3, 2020

Using the nuget (3.0.5) in a .NET Framework 4.8 project yields this error:

Exception: System.IO.FileNotFoundException
Message: Could not load file or assembly 'Mono.Posix, Version=4.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756' or one of its dependencies. The system cannot find the file specified.
Source: HardwareInformation
TargetSite: Void Open()
StackTrace:
at void HardwareInformation.Opcode.Open()
at MachineInformation HardwareInformation.MachineInformationGatherer.GatherInformation(bool skipClockspeedTest)

@L3tum
Copy link
Owner

L3tum commented Jan 13, 2020

Hi!

Apologies for the incredibly late answer; Github didn't send me any notification.

According to Mono it doesn't currently support .NET 4.8 as seen here. In theory Mono.Posix should be a .NET Standard2.0 package and as such be supported, but a quick test on my part with a new .NET 4.8 project shows that the Mono.Posix.dll is not copied to the output directory.

Since I'm only using it for a "small" part of the library, I'll consider dropping it in the next version and integrating it in another way. I'll need to check a few things before that though.

I currently do not know of a way to quickly resolve this issue aside from changing the framework target. Copying the Mono.Posix libraries in manually seems to cause a PInvoke error. Adding an explicit target framework to the HardwareInformation library for 4.8 immediately ends in error.

I'll keep this issue open for when either Mono supports .NET 4.8 or I'll have implemented an alternative.

Hope I could help

@L3tum L3tum added the bug Something isn't working label Jan 13, 2020
@steingran
Copy link
Author

Hello!

Ok, I was not aware that Mono did not support .NET 4.8. Then this issue makes more sense.

Thank you for your reply.

@L3tum
Copy link
Owner

L3tum commented Feb 9, 2020

Hey,

I removed the Mono.Posix dependency in #16 now and it should work as is.

I'll release a new version today or tomorrow for testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants