1
votes

I have an asp.net web api project whose output needs to be packaged in a setup project using wix.

I would like to precompile the site. The problem is that the precompilation process generates variable file names (ie. *.compiled files in particular).

I also would like to build the setup in a TFS build.

It seems that my only option is to generate a .wxs file wihtin the prebuild step of the wix project.

The .wxs files source paths are using $(var._My_Web_Project_.TargetDir). This seems to be translated to a Sources based directory.

I'm using paraffin to do that already and it works perfectly fine when building the solution with visual studio.

When building the solution through a TFS build, the .compiled files are copied to a Binaries folder, whereas all the other related web site files are copied to a Sources based directory.

The build errors are like the following :

The system cannot find the file 'd:\BuildAgents\___basedir___\Binaries\___web_project_dir\_PublishedWebSites\___site___\bin\textsample.cshtml.c6fb271c.compiled'.

The file is indeed in the Sources directory.

'd:\BuildAgents\___basedir___\Sources\___web_project_dir\_PublishedWebSites\___site___\bin\textsample.cshtml.c6fb271c.compiled'

I think I somehow need to redefine the aspnet_compiler output or something like this, but can't figure out how to do that.

The msbuild command line arguments are the follwing:

/p:GenerateProjectSpecificOutputFolder=true /p:VisualStudioVersion=14.0 /p:DeployOnBuild=true /p:PublishProfile=local /p:CleanWebProjectOutputDir=False /verbosity:d

EDIT 1: I'm using XAML build.

enter image description here

Any help appreciated.

EDIT 2: With the new task based build, it works as is (no need to use an additional Copy Files task).

The aspnet_compiler output the .compiled files in the correct folder :

C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_compiler.exe -v / -p D:\BuildAgents\vNext\_work\1\s\Softs\__Solution__\__Web_Project\obj\Release\AspnetCompileMerge\Source -c D:\BuildAgents\vNext\_work\1\s\Softs\__Solution__\__Web_Project__\obj\Release\AspnetCompileMerge\TempBuildDir

1
Do you use XAML build or new tasks based build system? How's your build definition like? - Cece Dong - MSFT
I'm using XAML build. - Olivier MATROT

1 Answers

0
votes

In the new tasks based build system, it's easy to copy files from a source folder to a target folder with Copy Files task.

enter image description here

Source Folder: Folder that contains the files you want to copy.

Contents: Specify minimatch pattern filters (one on each line) that you want to apply to the list of files to be copied.

Target Folder: Folder where the files will be copied. In most cases you specify this folder using a variable.