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.

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.