AnsweredAssumed Answered

2016 Add-In Template Visual Studio VB.net

Question asked by Jeffrey Wheeler on Dec 23, 2017
Latest reply on Jan 2, 2018 by Alex Burnett

I am using Solidworks 2016 SP5, Windows 10 and Microsoft Visual Studio 2017. I figured out how to extract the template for Visual Studio from the SDK and put the template in the correct folder for Visual Studio. I've tried the SDK version for SW 2016 sp5 and SW 2018 sp0. I can open the template fine, but without changing anything and trying to run the template I get build errors. I pasted the warnings below. I have the book Automating SOLIDWORKS 2017 Using Macros, and I followed the instructions in that book as well with no luck. Anyone have some advice or resources I can read to fix this issue? I appreciate any help.

 

The build errors and warnings:

Severity Code Description Project File Line Suppression State

Warning The primary reference "SolidWorks.Interop.sldworks" could not be resolved because it has an indirect dependency on the .NET Framework assembly "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" which has a higher version "4.0.0.0" than the version "2.0.0.0" in the current target framework. SwVBAddin3

 

Severity Code Description Project File Line Suppression State

Warning The primary reference "SolidWorks.Interop.swpublished" could not be resolved because it has an indirect dependency on the .NET Framework assembly "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" which has a higher version "4.0.0.0" than the version "2.0.0.0" in the current target framework. SwVBAddin3

 

Severity Code Description Project File Line Suppression State

Warning The primary reference "SolidWorks.Interop.swconst" could not be resolved because it has an indirect dependency on the .NET Framework assembly "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" which has a higher version "4.0.0.0" than the version "2.0.0.0" in the current target framework. SwVBAddin3

 

warning BC40056: Namespace or type specified in the Imports 'SolidWorks.Interop.sldworks' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases.

warning BC40056: Namespace or type specified in the Imports 'SolidWorks.Interop.swconst' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases.

error BC30002: Type 'DrawingDoc' is not defined.

error BC30002: Type 'ModelView' is not defined.

error BC30002: Type 'AssemblyDoc' is not defined.

error BC30002: Type 'PartDoc' is not defined.

error BC30002: Type 'ModelView' is not defined.

error BC30002: Type 'ModelDoc2' is not defined.

error BC30002: Type 'SldWorks' is not defined.

error BC30002: Type 'SldWorks' is not defined.

error BC30002: Type 'ModelDoc2' is not defined.

error BC30002: Type 'ModelView' is not defined.

error BC30002: Type 'SldWorks' is not defined.

error BC30002: Type 'ModelDoc2' is not defined.

error BC30002: Type 'SldWorks' is not defined.

error BC30002: Type 'ModelDoc2' is not defined.

error BC30002: Type 'SldWorks' is not defined.

error BC30002: Type 'ModelDoc2' is not defined.

error BC30451: 'swComponentSuppressionState_e' is not declared. It may be inaccessible due to its protection level.

... The list continues

Outcomes