0 Replies Latest reply on Feb 22, 2016 6:33 PM by John Howell

    VS2015 / SW2015 AddIn (from swvbAddIn template); Post Build Events

    John Howell

      I go through this every five years or so... and it's always a struggle to find where this is documented.

       

      I now have SW2015 and VS2015, and the swvbAddIn template for 2015. All is well.

       

      I run the AddIn from VS; SolidWorks starts; The AddIn does not show up.

       

      I recall always having to add Post Build Events in the VS Project, Compile Options, Build Events - to register the .dll after it builds... (code shown below).

       

      This is old code from years ago... Is it still valid? Necessary? Where is this documented so I can quit pestering you folks with these types of questions?

       

      Thank you as always for any help

       

      ===================================================

      IF EXIST "$(TargetDir)$(TargetName).bmp" (GOTO REGISTRATION)

      XCOPY "$(ProjectDir)AddinIcon.bmp" "$(TargetDir)"  /F

      REN "$(TargetDir)AddinIcon.bmp" "$(TargetName).bmp"

       

       

      :REGISTRATION

      IF "$(TargetFrameworkVersion)"=="v4.0" GOTO NET40

      IF "$(TargetFrameworkVersion)"=="v3.5" GOTO NET20

      IF "$(TargetFrameworkVersion)"=="v3.0" GOTO NET20

      IF "$(TargetFrameworkVersion)"=="v2.0" GOTO NET20

      GOTO END

       

       

      :NET40

      set FMWK="v4.0.30319"

      GOTO REG

       

       

      :NET20

      set FMWK="v2.0.50727"

      GOTO REG

       

       

      :REG

      IF "$(PlatformName)" == "AnyCPU" GOTO ANYCPU

      IF "$(PlatformName)" == "x64" GOTO X64

      GOTO END

       

       

      :ANYCPU

      IF EXIST "%Windir%\Microsoft.NET\Framework64\%FMWK%\regasm.exe" "%Windir%\Microsoft.NET\Framework64\%FMWK%\regasm" /codebase "$(TargetPath)"

      GOTO END

       

       

      :X64

      IF EXIST "%Windir%\Microsoft.NET\Framework64\%FMWK%\regasm.exe" "%Windir%\Microsoft.NET\Framework64\%FMWK%\regasm" /codebase "$(TargetPath)"

      GOTO END

       

       

      :END