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

Trouble with System.MissingMethodException #59

Open
DmitryYalchik opened this issue Nov 14, 2024 · 8 comments
Open

Trouble with System.MissingMethodException #59

DmitryYalchik opened this issue Nov 14, 2024 · 8 comments

Comments

@DmitryYalchik
Copy link

DmitryYalchik commented Nov 14, 2024

Debug on my PC working cool.
But when i make nuke createInstaller and send to my colleague for tests. He starting and plugin is not working.
Some trouble with SetImage.

Had think that's only in my project. Make new (clear) solution and application into. Same trouble.

image

@DmitryYalchik
Copy link
Author

DmitryYalchik commented Nov 14, 2024

I removed adding image

.SetImage("/WallsReinforcement;component/Resources/Icons/wallsReinforcenet16.png")
.SetLargeImage("/WallsReinforcement;component/Resources/Icons/wallsReinforcenet32.png")

And all working normal

@DmitryYalchik
Copy link
Author

DmitryYalchik commented Nov 14, 2024

I made my own extensions methods for adding images.

Now that's looking so:
image

Type is Image and Store as System.Byte[] (WPF)

panel.AddPushButton<StartupCommand>("Армирование")
    .OwnAddSmallImage(Properties.Resources.wallsReinforcenet16)
    .OwnAddLargeImage(Properties.Resources.wallsReinforcenet32);

⏬⏬⏬

public static class RibbonButtonExtension
{
    public static RibbonButton OwnAddSmallImage(this RibbonButton ribbonButton, byte[] image)
    {
        ribbonButton.Image = image.ToBitmap().ToImageSource();
        return ribbonButton;
    }
    public static RibbonButton OwnAddLargeImage(this RibbonButton ribbonButton, byte[] image)
    {
        ribbonButton.LargeImage = image.ToBitmap().ToImageSource();
        return ribbonButton;
    }
}

⏬⏬⏬

public static class ByteArrayExtension
{
    public static Bitmap ToBitmap(this byte[] data)
    {
        if (data == null || data.Length == 0)
        {
            throw new ArgumentNullException(nameof(data));
        }

        using (var ms = new MemoryStream(data))
        {
            return new Bitmap(ms);
        }
    }
}
public static class BitmapExtension
{
    public static ImageSource ToImageSource(this Bitmap bitmap)
    {
        IntPtr handle = bitmap.GetHbitmap();
        try
        {
            return Imaging.CreateBitmapSourceFromHBitmap(handle, IntPtr.Zero, Int32Rect.Empty,
                BitmapSizeOptions.FromEmptyOptions());
        }
        finally
        {
            NativeMethods.DeleteObject(handle);
        }
    }
    private static class NativeMethods
    {
        [DllImport("gdi32.dll", EntryPoint = "DeleteObject")]
        [return: MarshalAs(UnmanagedType.Bool)]
        public static extern bool DeleteObject([In] IntPtr hObject);
    }
}

@Nice3point
Copy link
Owner

This exception means that your colleague has a conflicting plugin installed, most likely an outdated version of RevitLookup. Try to update it or use a tool to find conflicting versions of Nice3point.Revit.Extensions library jeremytammik/RevitLookup#269 (comment)

@DmitryYalchik
Copy link
Author

He haven't LookUp on his Revit

@Nice3point
Copy link
Owner

So, use the DependenciesReport from the link above and share report here

@DmitryYalchik
Copy link
Author

Good morning. If u need all text from file - can send for u

### Revit version: 2024 ###

| Dependency                                                | BimStep_Отв | WorkMode  | Citrus [BIM] | WallsReinforcement | Collaborate | ProSheets | Coordination Model | Coordination Model Interface | Application Dynamo Player For Revit | Lightbox DB extension | Lightbox UI extension | EntitlementDB | Revit Application Home | P&ID Modeler | Revit Shared Views | Link Topograhy Commands | Link Topography Parser Application |
|-----------------------------------------------------------|-------------|-----------|--------------|--------------------|-------------|-----------|--------------------|------------------------------|-------------------------------------|-----------------------|-----------------------|---------------|------------------------|--------------|--------------------|-------------------------|------------------------------------|
| Autodesk.Extensions.Json.dll                              | -              | -         | -            | -                  | 9.3.2       | -         | -                  | -                            | -                                   | -                     | -                     | -             | -                      | 10.0.0       | -                  | -                       | -                                  |
| Microsoft.Bcl.AsyncInterfaces.dll                         | -              | -         | -            | 8.0.23             | -           | -         | 4.700.20           | 4.700.20                     | -                                   | -                     | -                     | -             | -                      | -            | -                  | -                       | -                                  |
| Microsoft.Extensions.DependencyInjection.Abstractions.dll | -              | -         | -            | 8.0.1024           | -           | -         | -                  | -                            | -                                   | -                     | -                     | -             | -                      | 2.2.0        | -                  | -                       | -                                  |
| Microsoft.Extensions.DependencyInjection.dll              | -              | -         | -            | 8.0.1024           | -           | -         | -                  | -                            | -                                   | -                     | -                     | -             | -                      | 2.2.0        | -                  | -                       | -                                  |
| Microsoft.Xaml.Behaviors.dll                              | -              | 1.1.19    | -            | 1.1.39             | -           | 1.1.39    | -                  | -                            | -                                   | -                     | -                     | -             | -                      | -            | -                  | -                       | -                                  |
| Newtonsoft.Json.dll                                       | 13.0.3         | 13.0.1    | 13.0.3       | -                  | 13.0.1      | 12.0.2    | -                  | -                            | -                                   | -                     | -                     | 13.0.1        | 13.0.1                 | 13.0.1       | -                  | 13.0.1                  | 13.0.1                             |
| RestSharp.dll                                             | -              | -         | -            | -                  | -           | 106.15.0  | 106.12.0           | 106.12.0                     | -                                   | 106.12.0              | 106.12.0              | -             | -                      | -            | -                  | -                       | -                                  |
| System.Memory.dll                                         | -              | 4.6.31308 | -            | 4.6.31308          | -           | -         | -                  | -                            | -                                   | -                     | -                     | -             | -                      | 4.6.28619    | -                  | -                       | -                                  |
| System.Net.Http.Formatting.dll                            | -              | -         | -            | -                  | 5.2.61129   | 4.0.21112 | -                  | -                            | -                                   | -                     | -                     | -             | -                      | -            | -                  | -                       | -                                  |
| System.Runtime.CompilerServices.Unsafe.dll                | -              | 5.0.20    | -            | 6.0.21             | -           | -         | -                  | -                            | -                                   | -                     | -                     | -             | -                      | 4.6.28619    | -                  | -                       | -                                  |
| System.Threading.Tasks.Dataflow.dll                       | -              | -         | -            | -                  | -           | -         | -                  | -                            | 4.5.24                              | -                     | -                     | -             | -                      | -            | 4.700.19           | -                       | -                                  |
| System.Threading.Tasks.Extensions.dll                     | 4.6.24705      | 4.6.28619 | 4.6.24705    | 4.6.28619          | -           | -         | 4.6.28619          | 4.6.28619                    | -                                   | -                     | -                     | -             | -                      | -            | -                  | -                       | -                                  |
| Xceed.Wpf.Toolkit.dll                                     | -              | 4.3.0     | -            | -                  | -           | 3.4.0     | -                  | -                            | -                                   | -                     | -                     | -             | -                      | -            | -                  | -                       | -                                  |


@Nice3point
Copy link
Owner

@DmitryYalchik sorry for late response. Thats totally fine for your environment, no conflict. But your colleague have to run this tool and than send me his file

@DmitryYalchik
Copy link
Author

No problem :)
That's was his data.
Now i can't make duplicate cus he is fired and his pc is cleaned

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