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

SRM gives weird results #396

Closed
Damicske opened this issue Aug 7, 2023 · 3 comments
Closed

SRM gives weird results #396

Damicske opened this issue Aug 7, 2023 · 3 comments

Comments

@Damicske
Copy link

Damicske commented Aug 7, 2023

Version of SharpShell used: 2.7.2

Related type(s) of SharpShell-Server: Any

So when I use the SRM to install the deskband I got a wonderful message back: https://imgur.com/YEA5pa8

I trying to get a own working version of the deskband demo project in C# and VB.net, so I know what's going wrong and I can adjust my deskband I'm building for a long time :(

I've started the new c# project: "Class library (.NET Framework)", the code is almost a copy just some changes in naming to see if it works or not.

using System.Runtime.InteropServices;
using SharpShell.Attributes;
using SharpShell.SharpDeskBand;

namespace WebSearchDeskBand_CS
{
    [ComVisible(true)]
    [DisplayName("Web Search CS")]
    public class WebSearchDeskBand : SharpDeskBand
    {
        protected override System.Windows.Forms.UserControl CreateDeskBand()
        {
            return new UserControl1();
        }

        protected override BandOptions GetBandOptions()
        {
            return new BandOptions
            {
                HasVariableHeight = false,
                IsSunken = false,
                ShowTitle = true,
                Title = "Web Search CS",
                UseBackgroundColour = false,
                AlwaysShowGripper = true
            };
        }
    }
}

The project is signed without a password.

Another error was: https://imgur.com/t6q2rxf but that happens when you build the project as x64, srm doesn't like that.

For reference, the demo project runs here: https://imgur.com/Xq9NXgn. I've downloaded everything and then Nuget > Sharpshell and build it then "SRM -install" it

Any view on it?

@Countryen
Copy link
Collaborator

Hey there,

that first error looks like a mismatch of SharpShell version.

Can you verify that you use the same SharpShell version (DLL) that the SRM uses? For example, I have seen this error before, when I was using the online distributed srm.exe from GitHub with my DLL with the latest version of SharpShell. So make sure they match. I've had best results by just compiling/building the SRM (ServerRegistrationManager) project myself, so maybe try that, too.

If unsure, you could try inspecting the DLL references (SharpShell v.???) with a Disassembler like ILSpy.

Example:
image

Not sure what "SRM" you are using (looks like just srm which I used to have problems with) but I just use the ServerRegistrationManager.exe whenever I test something out, so that should work. And the Download for that (release) comes with the SharpShell.dll, too.

Hope that helps a bit.

@Damicske
Copy link
Author

Damicske commented Aug 9, 2023

OMBG that's the fault :o It just registers now and sits nicely in the toolbar menu

D:\server\MyProjects\test\WebSearchDeskBand_CS\bin\Release>ServerRegistrationManager install WebSearchDeskBand_CS.dll -codebase -os64

========================================
SharpShell - Server Registration Manager

WebSearchDeskBand_CS.dll installed and registered.

Microsoft .NET Framework Assembly Registration Utility version 4.8.9037.0
for Microsoft .NET Framework version 4.8.9037.0
Copyright (C) Microsoft Corporation. All rights reserved.

Types registered successfully

@Damicske
Copy link
Author

Damicske commented Aug 9, 2023

Pushed the wrong button, must be close with comment ;)

@Damicske Damicske closed this as completed Aug 9, 2023
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

2 participants