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

Exception during design of CadCanvas control #185

Open
johnnyontheweb opened this issue Oct 31, 2024 · 3 comments
Open

Exception during design of CadCanvas control #185

johnnyontheweb opened this issue Oct 31, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@johnnyontheweb
Copy link

johnnyontheweb commented Oct 31, 2024

Hello,
I'm trying to using CadCanvas control in a Winform app. During design, devEnv.exe is often terminated by this error:
Cannot find method 'Void CADability.IPaintTo3D.PrepareIcon(System.Drawing.Bitmap)'.
System.MissingMethodException

stacktrace:
in CADability.Forms.CadCanvas.Dispose(Boolean disposing)
in System.ComponentModel.Component.Finalize() in System.ComponentModel\Component.cs: riga 85

I discovered this with another instance of devEnv attached for debugging the main one. I'm using GDI2view.
Any clue?

@dsn27
Copy link
Collaborator

dsn27 commented Dec 5, 2024

I'm sorry I have never seen this error before. But also never use PaintToGDI.
Any chance you can provide a small sample project to reproduce this error?

@johnnyontheweb
Copy link
Author

Hello, thanks for replying. It's a simple Winform project with a CadControl in it. The code to initialize the view is:

        Dim cadFrame = New CadFrame(CadCanvas1, Me)
        Dim proj = cadFrame.Project
        Dim newGDIView As New GDI2DView(proj, proj.GetActiveModel, cadFrame)
        proj.GdiViews.Add(newGDIView)
        cadFrame.ActiveView = newGDIView

I believe that's all.
I often get the exception reported (System.MissingMethodException) expecially when opening the form in Visual Studio form designer.

@dsn27 dsn27 added the bug Something isn't working label Dec 13, 2024
@dsn27
Copy link
Collaborator

dsn27 commented Dec 13, 2024

After some trying I can now reproduce this error.
Mine is a little bit different:

I just need to open MainForm.cs in the Visual Studio designer.
grafik

Visual Studio sometimes crashes.
Eventlog:

System.MissingMethodException
   at CADability.Forms.CadCanvas.Dispose(Boolean)
   at System.ComponentModel.Component.Finalize()

This doesn't happen if you open the CadForm from CADability.Forms.

I used Fuslogvw to try to get more information:


=== Pre-bind state information ===
LOG: DisplayName = CADability.Forms, Version=1.0.0.0, Culture=neutral, PublicKeyToken=62ba9c16fd2eecf7
 (Fully-specified)
LOG: Appbase = file:///C:/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = devenv.exe
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Users\UserName\AppData\Local\Microsoft\VisualStudio\17.0_429554e8\devenv.exe.config
LOG: Using host configuration file: 
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Post-policy reference: CADability.Forms, Version=1.0.0.0, Culture=neutral, PublicKeyToken=62ba9c16fd2eecf7
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/CADability.Forms.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/CADability.Forms/CADability.Forms.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/PublicAssemblies/CADability.Forms.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/PublicAssemblies/CADability.Forms/CADability.Forms.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/PrivateAssemblies/CADability.Forms.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/PrivateAssemblies/CADability.Forms/CADability.Forms.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/CommonExtensions/Microsoft/TestWindow/CADability.Forms.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/CommonExtensions/Microsoft/TestWindow/CADability.Forms/CADability.Forms.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/CommonExtensions/Platform/Debugger/CADability.Forms.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/CommonExtensions/Platform/Debugger/CADability.Forms/CADability.Forms.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/PrivateAssemblies/DataCollectors/CADability.Forms.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/PrivateAssemblies/DataCollectors/CADability.Forms/CADability.Forms.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/PrivateAssemblies/DataCollectors/x64/CADability.Forms.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/PrivateAssemblies/DataCollectors/x64/CADability.Forms/CADability.Forms.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/CADability.Forms.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/CADability.Forms/CADability.Forms.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/PublicAssemblies/CADability.Forms.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/PublicAssemblies/CADability.Forms/CADability.Forms.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/PrivateAssemblies/CADability.Forms.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/PrivateAssemblies/CADability.Forms/CADability.Forms.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/CommonExtensions/Microsoft/TestWindow/CADability.Forms.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/CommonExtensions/Microsoft/TestWindow/CADability.Forms/CADability.Forms.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/CommonExtensions/Platform/Debugger/CADability.Forms.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/CommonExtensions/Platform/Debugger/CADability.Forms/CADability.Forms.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/PrivateAssemblies/DataCollectors/CADability.Forms.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/PrivateAssemblies/DataCollectors/CADability.Forms/CADability.Forms.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/PrivateAssemblies/DataCollectors/x64/CADability.Forms.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/PrivateAssemblies/DataCollectors/x64/CADability.Forms/CADability.Forms.EXE.
LOG: All probing URLs attempted and failed.

I'm not sure why Visual Studio is searching in these places for the DLL. But even installing CADability.Forms.dll and CADability.dll into the GAC does not help.
The error in Fuslogvw goes away but the error in Visual Studio stays the same.

Any ideas would be welcome.

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

No branches or pull requests

2 participants