2

Using RMO, I have created a Visual Studio build definition. In the Copy Files step, if I give the contents as

**\*.zip

it creates a zip file of my compiled project along with the web.config file. I need to add some additional config files to this zip which are solution level folder and not in the project folder. These 3 files are copied over to the project folder in a pre build event. So I cant set Build Action = Content for these files.

jessehouwing
  • 106,458
  • 22
  • 256
  • 341
webdevbing
  • 322
  • 1
  • 3
  • 12

1 Answers1

3

You can add following codes into your project file to include the extra files in the zip during the build:

<Target Name="CustomCollectFiles">
    <ItemGroup>
      <_CustomFiles Include="PathToExtraFile" />
        <FilesForPackagingFromProject Include="%(_CustomFiles.Identity)">
          <DestinationRelativePath>%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
        </FilesForPackagingFromProject>
      </ItemGroup>
  </Target>

  <PropertyGroup>
    <CopyAllFilesToSingleFolderForPackageDependsOn>
      CustomCollectFiles;
      $(CopyAllFilesToSingleFolderForPackageDependsOn);
    </CopyAllFilesToSingleFolderForPackageDependsOn>
    <CopyAllFilesToSingleFolderForMsdeployDependsOn>
      CustomCollectFiles;
      $(CopyAllFilesToSingleFolderForPackageDependsOn);
    </CopyAllFilesToSingleFolderForMsdeployDependsOn>
  </PropertyGroup>

Refer to this link for details: ASP.NET Web Deployment using Visual Studio: Deploying Extra Files

Eddie Chen - MSFT
  • 29,708
  • 2
  • 46
  • 60