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

(64bit assembley) File " " is not a sharpshell server. #408

Open
imustnep opened this issue Jun 27, 2024 · 0 comments
Open

(64bit assembley) File " " is not a sharpshell server. #408

imustnep opened this issue Jun 27, 2024 · 0 comments

Comments

@imustnep
Copy link

Version of SharpShell used: 2.7.2.0

Related type(s) of SharpShell-Server: Thumbnail handler

Hello Mr. Kerr. Thank you for making this program which is helpful for so many. I'm sorry if I ask too much of a newbie question.

I've made a thumbnail handler for .avif and .heic images which works on my 32bit Win7 PC. I can't seem to get it working on my 64bit Win10 PC.
My project targets Net Framework 4.8. LibHeifSharp comes for "Any CPU" and Net Standard 2.0. I also tried a 64-bit only version of LibHeifSharp which made no difference. I compiled the native dlls both 32bit and 64bit using vcpkg.

To get an image from the SelectedItemStream it uses LibHeifSharp bindings for native libheif which then loads aom or libde265 to decode the image file. If it fails to do this, it instead displays an error thumbnail.
When built for "Any CPU" and using the 32bit versions of these dlls, it works fine in the 32bit Win7 explorer. It also works as expected in the Server Manager on both computers. It displays the error thumbnail in the Win10 64bit shell.
When built for "Any CPU" and using the 64bit versions of these dlls, it displays the error thumbnail in Server Manager and in the Win10 64bit shell.
When building my project for x64 only, I hoped to finally use the 64bit dlls. When loading my assembly in Server Manager, I get the error message File LibHeifSharpshell.dll is not a Sharpshell Server.
Do you think I should be able to load a x64-only SharpShell server? Is it necessary to compile for "Any CPU," and if not, do you think using a x64-only server would help me?
When compiled for "Any CPU" I was at least able to send some bitmap to the 64bit shell, but I'm worried that I can't load libraries because of bitness mismatch.
I'm not sure if there is a problem with LibHeifSharp or if it's a general .NET problem. I will keep looking into it, but was hoping to hear from someone who understands better.

Log Messages

2024-06-27 16:44:21.133Z - ServerManager - LibHeifThumbnailHandler: Intiailising a stream based server.
2024-06-27 16:44:21.134Z - ServerManager - LibHeifThumbnailHandler: GetThumbnail for item stream, width 185.
2024-06-27 16:44:21.135Z - ServerManager - error: LibHeifThumbnailHandler: An exception occurred opening the image file.
2024-06-27 16:44:21.136Z - ServerManager - error: System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
at LibHeifSharp.Interop.LibHeifNative.heif_get_version_number()
at LibHeifSharp.LibHeifInfo.GetLibHeifVersionNumber()
at System.Lazy1.CreateValue() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Lazy1.get_Value()
at LibHeifSharp.LibHeifVersion.ThrowIfNotSupported()
at LibHeifSharp.HeifContext..ctor(Stream stream, Boolean leaveOpen)
at LibHeifSharpShell.LibHeifThumbnailHandler.GetThumbnailImage(UInt32 width) in C:\code\avif shell extension\LibHeifSharpshell\ThumbnailHandler.cs:line 28

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant