1

I'm developing web api in .NET 4.5.1. It is build on TeamCity CI server, but I would like to deploy it to the Windows 7 machine in the local network after every successful build. I wanted to use dnu publish command, but I have no idea how to use it in this case and how to prepare Windows 7 machine to be ready to receive new, just builded application. This issue is realy poorly described in case of new ASP.

Kuba Matjanowski
  • 350
  • 3
  • 14

1 Answers1

1

You need to run:

dnu publish --runtime <name of runtime or "active">

Optionally, you can also pass --no-source.

Once you do that, the bin/output folder will have the application, its dependencies and the runtime. Then, all you have to do is copy that folder to your Win 7 machine.

Here's a script that does something similar for the MusicStore sample. We use it to deploy MusicStore on Nano Server

Victor Hurdugaci
  • 28,177
  • 5
  • 87
  • 103
  • Thank you for your answer! It describes perfectly how to copy binaries! The only think I'm not sure about is running the application remotely after copy. How Win7 machine knows, that I just provided the new version of application? It should stop somehow existing service, and run new binaries. – Kuba Matjanowski Nov 21 '15 at 11:58
  • Let's assume, I'm using self hosting (dnx command - on Kestrel server) – Kuba Matjanowski Nov 21 '15 at 23:20
  • You have to manually start the application after publish. That's up to you how you do it. Assuming the name of the command that runs Kestrel in project.json is "Kestrel" then your published app will have a "Kestrel.cmd" file in "approot". You have to run that. When you want to update the app, you have to stop the process started by Kestrel.cmd, update the files and restart the app – Victor Hurdugaci Nov 22 '15 at 02:06