Splitting an addin across multiple C# dlls

17 views
Skip to first unread message

tbischel

unread,
Jul 31, 2009, 1:30:35 PM7/31/09
to SolidWorks-API
Hi,
I created a utility class that I'd like to use in multiple addins as
a referenced dll. The code works fine so long as its included as
source in the addin, but if I split it out into a separate dll and
reference it, SolidWorks complains that parts of the program are
missing when the program is opened.
Has anyone been able to successfully resolve this type of issue
before? I was thinking maybe the dll's should be statically linked (I
don't know if C# supports static linking), or perhaps the utility must
be registered to the GAC, or something like that.
Thanks,
--Tyler

Corey Scheich

unread,
Aug 15, 2009, 11:42:48 PM8/15/09
to solidwo...@googlegroups.com
Tyler,

I have setup addins with many dlls with no problems in the past.  If the problem is on your dev computer make sure that you have the dll in the same folder the addin is registered in.  To check open the Tools>addins dialog and select the problem addin and see which folder the tooltip says the addin is in.  Then go to that folder and verify your other dll is there.  Otherwise the DLL may not be getting registered correctly or the .Net framework required by the addin is not installed on the target computer.  You definitely should not need to have the DLL in the GAC.  Another problem you may run into is if another addin is loading a different version of the shared dll that is not compatible for any number of reasons.

Regards,

Corey Scheich

> Date: Fri, 31 Jul 2009 10:30:35 -0700
> Subject: Splitting an addin across multiple C# dlls
> From: tbis...@gmail.com
> To: SolidWo...@googlegroups.com


Get free photo software from Windows Live Click here.

tbischel

unread,
Sep 3, 2009, 7:25:52 PM9/3/09
to SolidWorks-API
So I found the solution to my problem was that my dlls were not COM
visible. https://forum.solidworks.com/thread/25931
Thanks for the response.
--Tyler

On Aug 15, 8:42 pm, Corey Scheich <cdsmor...@hotmail.com> wrote:
> Tyler,
> I have setup addins with many dlls with no problems in the past.  If the problem is on your dev computer make sure that you have the dll in the same folder the addin is registered in.  To check open the Tools>addins dialog and select the problem addin and see which folder the tooltip says the addin is in.  Then go to that folder and verify your other dll is there.  Otherwise the DLL may not be getting registered correctly or the .Net framework required by the addin is not installed on the target computer.  You definitely should not need to have the DLL in the GAC.  Another problem you may run into is if another addin is loading a different version of the shared dll that is not compatible for any number of reasons.
> Regards,
> Corey Scheich
>
>
>
>
>
> > Date: Fri, 31 Jul 2009 10:30:35 -0700
> > Subject: Splitting an addin across multiple C# dlls
> > From: tbisc...@gmail.com
> > To: SolidWo...@googlegroups.com
>
> > Hi,
> >   I created a utility class that I'd like to use in multiple addins as
> > a referenced dll.  The code works fine so long as its included as
> > source in the addin, but if I split it out into a separate dll and
> > reference it, SolidWorks complains that parts of the program are
> > missing when the program is opened.
> >   Has anyone been able to successfully resolve this type of issue
> > before?  I was thinking maybe the dll's should be statically linked (I
> > don't know if C# supports static linking), or perhaps the utility must
> > be registered to the GAC, or something like that.
> > Thanks,
> > --Tyler
>
> _________________________________________________________________
> Get free photo software from Windows Livehttp://www.windowslive.com/online/photos?ocid=PID23393::T:WLMTAGL:ON:...
Reply all
Reply to author
Forward
0 new messages