0

I have a Visual Studio Extension (VSIX package) that shows a WinForms dialog and then returns a string that is inserted into the code editor window in VS.

The WinForm loads fine. I can return a hard coded string and VS puts it into the editor. However, if the WinForm makes a call to a 3rd party library (it is a .Net Core class library) it stops execution without an exception I can see and closes the form out. To test further, I had the referenced library simply return a hard coded string so there wasn't risk of an Exception in that code and it failed it (which makes me believe it's the action of calling the library.. if I step through this with a debugger it will not execute a procedure that makes a called to the referenced library.. if I comment out that line it will step through that procedure). If I pluck the form out and put it in a WinForms app it executes as expected.

The referenced library was loaded into the extension via a local NuGet feed.

  1. The 3rd party library isn't signed currently, could that be the issue?
  2. The 3rd party library is a "Class Library (.Net Core)".. there's no option I can see through the GUI to sign the library like you can with traditional class libraries (although this targets .Net 4.6). The WinForm itself can call it if it's in a different solution, it barfs when run through the VS Extension.
  3. What else could cause this problem?

Side note, this is an extension for myself and not general distribution.

b.pell
  • 3,873
  • 2
  • 28
  • 39

1 Answers1

0

Will post this for posterity. Visual Studio appears stop the execution of the code in the extension when it makes a call out to an unsigned assembly. I tested this by signing the 3rd party assemblies (it then worked). The VSIX also signs itself by default if you use the template to create that project in Visual Studio.

b.pell
  • 3,873
  • 2
  • 28
  • 39
  • 1
    Visual Studio doesn't care about the signedness, but if you are shipping an extra DLL, you have to tell VS where to find that DLL. It's possible that by signing it something changed with the loader. You should use a ProvideCodebaseAttribute to make things explicit. – Jason Malinowski Sep 01 '16 at 00:24
  • That's interesting, I will test that tomorrow. Thanks for the additional info. – b.pell Sep 01 '16 at 23:36