What are the challenges you face when working across database platforms? Take the survey
Options

Using Setup and Deployment Project (VB.NET Winform App)

I am evaluating the trial for version 8, and installed the Nuget MSBuild.  In the VB.NET project, I have the compile setting set to obj\release. 

When setting up the SA GUI, I first opened the .exe in obj\release, and then pointed the output to the same folder that has .saproj, .sln, and vbproj.  

An issue is however, that I also have a Setup & Deployment project inside the solution (.sln), and noticed that the protected output is the .exe in the folder with .saproj, .sln, and .vbproj.  Therefore, how is the Setup & Deployment going to grab the protected output from this folder, when it usually gets the output from \obj\release (which is unprotected)?
Tagged:

Answers

  • Options
    LPetersonLPeterson Posts: 7 New member
    I looked at some notes from previous support and remembered that there is an overwrite command required to write the protected .exe over the .exe in \obj\release so that the setup & deployment project will pick up and deploy the protected output.  

    Since SA now auto-generates code in the .vbproj file and my legacy code for V7 in .vbproj no longer works, what is the new overwrite command and where should it be placed in the auto-generated code below:

      <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
        <PropertyGroup>
          <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
        </PropertyGroup>
        <Error Condition="!Exists('packages\RedGate.SmartAssembly.MSBuild.8.0.4.4860\build\RedGate.SmartAssembly.MSBuild.props')" Text="$([System.String]::Format('$(ErrorText)', 'packages\RedGate.SmartAssembly.MSBuild.8.0.4.4860\build\RedGate.SmartAssembly.MSBuild.props'))" />
        <Error Condition="!Exists('packages\RedGate.SmartAssembly.MSBuild.8.0.4.4860\build\RedGate.SmartAssembly.MSBuild.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\RedGate.SmartAssembly.MSBuild.8.0.4.4860\build\RedGate.SmartAssembly.MSBuild.targets'))" />
      </Target>
      <Import Project="packages\RedGate.SmartAssembly.MSBuild.8.0.4.4860\build\RedGate.SmartAssembly.MSBuild.targets" Condition="Exists('packages\RedGate.SmartAssembly.MSBuild.8.0.4.4860\build\RedGate.SmartAssembly.MSBuild.targets')" />


  • Options
    LPetersonLPeterson Posts: 7 New member
    RESOLVED:  I added the lines below to the bottom of the .vbproj file, just above the ending </Project>

      <!-- Optional SmartAssembly properties -->
      <PropertyGroup>
        <SmartAssemblyOverwriteAssembly>True</SmartAssemblyOverwriteAssembly>
      </PropertyGroup>
      <!-- /Optional SmartAssembly properties -->

      and the .exe in obj\release was overwritten with the protected .exe.   Now, Setup & Deployment will correctly fetch and deploy the protected .exe. 



Sign In or Register to comment.