sharpshell
sharpshell copied to clipboard
Problem ReadOnlyFileIconOverlayHandler with Server Manager
Version of SharpShell used: 2.7.1.0
Related type(s) of SharpShell-Server: ReadOnlyFileIconOverlayHandler
Hello,
I used sharpshell and I wrote C# code your sample "ReadOnlyFileIconOverlayHandler". But I can not run this code. I run Server Manager and I choosed class library dll , I can see the followings
Server Name Type CLSID Invalid Invalid 0000000-000000-00...
.net framework is 4.6.1 sign yes
can you help me?
What I have tried:
I want change a icon of file(*.txt , *.csv , *.doc ... ). The file has got special data. I want to sign this file changing its icon. And I will write custom attiribute that this file has got what type special data. then using windows explorer rigth click on the file I will show this custom attirubute "has got special data"
Hey BOruc, looks to me like the version of your "ServerManager" and the version of your Server is not the same.
Server Manager can only (!) manage Libraries (that you wrote) that use exactly the same version of SharpShell.dll
You are using the NuGet-Package of SharpShell in your project (?), maybe you can share the content of your *.csproj-file for further assistance?
- Please check that it's the correct version (2.7.1).
- Please check which version of Server Manager you use.
- In Server Manager, at the top: Help > About...
One additional request: Can you please change the name of this issue to something more useful? Like "Problem registering Example ReadOnlyFileIconOverlayHandler with Server Manager". Makes later searching for this issue more comfortably.
Hi dwmkerr,
First of all , thank you for paying attention.
You were rigth,
My Server Manager is old version,
I download sharpshell project from github.
But I cant not build it. I get this error.
I havent got this folder "C:\Users\xxx\Downloads\SharpShell\sharpshell-master\SharpShell\artifacts\build\SharpShellNativeBridge*.*"
4 Şubat 2019, 07:19 saatinde, Countryen [email protected] tarafından yazıldı:
Hey BOruc, looks to me like the version of your "ServerManager" and the version of your Server is not the same.
Server Manager can only (!) manage Libraries (that you wrote) that use exactly the same version of SharpShell.dll
You are using the NuGet-Package of SharpShell in your project (?), maybe you can share the content of your *.csproj-file for further assistance?
Please check that it's the correct version (2.7.1). Please check which version of Server Manager you use. In Server Manager, at the top: Help > About... One additional request: Can you please change the name of this issue to something more useful? Like "Problem registering Example ReadOnlyFileIconOverlayHandler with Server Manager". Makes later searching for this issue more comfortably.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
Just delete the post/pre-build events from the projects and you can build it.
From the settings of a project select "build events" and then delete the the pre and post scripts. Then you should be able to build the project(s). These scripts are necessary for the release of a new version / building the whole solution.
I'd recommend using the prebuilt one, though(https://github.com/dwmkerr/sharpshell/releases/tag/v2.7.1).
Hi,
First of all ,Thank you for paying attention again,
I used the prebuilt one, though(https://github.com/dwmkerr/sharpshell/releases/tag/v2.7.1).
and server manager was run. I took good result.
I developed new program.
New program is succesed in server manger tool.
But I want to see the result in windows explorer I got the following error.
I add new code. I registered dsofile.dll and I changed platform target from any cpu to x86 but got the following
I will see error this line in my code
OleDocumentProperties myFile = new DSOFile.OleDocumentProperties();
protected override bool CanShowOverlay(string path, FILE_ATTRIBUTE attributes) { try { // Return true if the file is read only, meaning we'll show the overlay. return has_PersonelData(path); } catch (Exception) { return false; } }
private bool has_PersonelData(string fileName) { //https://stackoverflow.com/questions/19947887/add-new-metadata-properties-to-a-file bool result = false; try { OleDocumentProperties myFile = new DSOFile.OleDocumentProperties(); //myFile.Open(@"C:\paylas\WordDeneme.docx", false, DSOFile.dsoFileOpenOptions.dsoOptionDefault); myFile.Open(fileName, false, DSOFile.dsoFileOpenOptions.dsoOptionDefault);
//Then check if there's already a property like the one you want to create: foreach (DSOFile.CustomProperty property in myFile.CustomProperties) { if (property.Name == "BKM-PersonelData") {
MessageBox.Show("Find File=>:" + fileName); //this line for test result= true; } } } catch(Exception ex) { if (fileName.IndexOf("WordDeneme.docx") > 0) MessageBox.Show(fileName+ (char)13+ (char)13+ex.Message.Trim());// this line for test } return result; }
}
4 Şubat 2019, 08:21 saatinde, Countryen [email protected] tarafından yazıldı:
Just delete the post/pre-build events from the projects and you can build it.
From the settings of a project select "build events" and then delete the the pre and post scripts. Then you should be able to build the project(s). These scripts are necessary for the release of a new version / building the whole solution.
I'd recommend using the prebuilt one, though(https://github.com/dwmkerr/sharpshell/releases/tag/v2.7.1).
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
Hey BOruc,
please try to use the "code-formatting" feature in the future. It's easier to follow along this way. Also you are writing
But I want to see the result in windows explorer I got the following error.
But there is no error-text? Maybe there should be a an image or something? Please check that, because I don't see the problem.
But before you do that... Please consider opening a new issue if the original issue is fixed, which I think it is because you wrote:
and server manager was run. I took good result.
Hey @Orucb, you haven't gotten back to this issue in a while. Is this still a problem/issue for you or did you solve it? Feel free to share your solution, and then, please close the issue.