6 Replies Latest reply on Aug 14, 2013 5:27 PM by John Girgenti

    C# add-in problem with SolidWorks.Interop.swpublished

    John Girgenti

      I started an add-in built in Visual Studio 2010 and I had no problems using the SolidWorks C-Sharp template files. I am now using VS 2012 for the exact same set of project files and I get errors for every usage of SwAddin that has an extension.

      • I have the correct 'using' statement: using SolidWorks.Interop.swpublished;
      • I have SolidWorks.Interop.swpublished.dll in the references.
      • The definition for SwAddin does not show any errors;  protected SwAddin userAddin;
      • All usages have errors: iSwApp = (ISldWorks)userAddin.SwApp;, this.swAddin.AttachModelDocEventHandler(modDoc);, userAddin.DetachModelEventHandler(document);

       

      This problem only occurs when I use VS2012 with this project (tried multiple machines).  I've copied SolidWorks.Interop.swpublished.dll from other SolidWorks 2013 installs in case one was corrupt.  The error that I get in the VS IDE is: 'SolidWorks.Interop.swpublished.SwAddin' does not contain a definition for '{Extension}' and no extension method '{Extension}' accepting a first argument of type 'SolidWorks.Interop.swpublished.SwAddin' could be found. I cannot find anything wrong with the project settings, files, etc. Any ideas?

       

      TIA,

      John