WinForms Libraries & Standard .NET Libraries

Hi,

I notice that I can add a reference to my own custom DLL using #r within Workbooks. I can do this with a standard WinForms DLL which means I can create working documents training new employees on how to use our own custom libraries. However if these show custom WinForms screens such as a messagebox the code 'Runs' forever. Is this by design?

Also, how do I add a reference to System.Data? Would I need to copy the DLL into the workbook folder or is there a way to add assemblies from the GAC?

Answers

  • SandyArmstrongSandyArmstrong USXamarin Team, Insider Xamurai

    You should be able to #r "System.Data", or any other assembly that's in the GAC.

    System.Windows.Forms.MessageBox.Show is a blocking synchronous call. You will need to alt-tab to the message box that is being displayed and dismiss it before the workbook evaluation completes.

    WPF workbooks should be able to use WinForms just as well as any WPF app does.

  • AdamLonsdale.3550AdamLonsdale.3550 GBUniversity ✭✭

    Looks like if I put the #r "System.Data" right at the top of the workbook I still get the error, but if I put it immediately before the call I need it for - it works just fine. Thanks for your help, perhaps a bug that needs logging?

  • SandyArmstrongSandyArmstrong USXamarin Team, Insider Xamurai

    @AdamLonsdale.3550 Could you provide exact steps with a fresh WPF workbook to cause the error you are seeing?

    We have been making pretty big improvements to reference resolution and I'd like to see if this problem is fixed in the upcoming release.

Sign In or Register to comment.