5

Is it possible to invoke dnu publish with the --no-source attribute from MSBuild when triggering the FileSystemPublish target?

MSBuild command:

/t:Build,FileSystemPublish /p:PublishConfiguration=$(BuildConfiguration) /p:PublishOutputPathNoTrailingSlash=$(build.stagingDirectory)

MSBuild ultimately calls the following:

dnu publish "C:/MyApplication" --out "C:/a/MyApplication" --configuration Release --runtime dnx-clr-win-x86.1.0.0-beta6 --quiet

I would like to append the --no-source attribute.

Dave New
  • 38,496
  • 59
  • 215
  • 394

1 Answers1

3

you can pass /p:compileSource=true to set the --no-source option during dnu publish.

(Also, you don't have to use the specific publish target FileSystemPublish, you can set the msbuild property /p:deployOnBuild=true to publish after build.)

vijayrkn
  • 461
  • 4
  • 7
  • In VS RC2 tooling, this option is no longer available. To publish RC1 dnx based projects (with --no-source option) with rc2 tooling installed you need to follow the instructions from here - http://stackoverflow.com/questions/37397315/visual-studio-2015-latest-update-publish-function-does-not-compile-asp-net-cor/37425515 – vijayrkn May 25 '16 at 20:30