'how to setup Teamcity (2021.2.2) deploy app with clickonce
I have a simple wpf/console app build that I want to deploy and be able to update where ever it is installed. So I picked clickonce, from ms, because that seamed to fit my needs.
I can build, deploy, install and update it manually quite fine ;-) but when I move to do the same steps on my teamcity build server, i ran into trouble.
I have a very simpel pipeline.
- build the app (works fine)
- make the setup.exe, to be installed.. <= trouble !!
- copy to an ISS hosted website.
If I run through step 2 manually in visual studio on the buildserver, it works. I get the binaries published in a folder. That I can copy to the IIS folder. but nothing is produced with TeamCity !!!
- what am I doing wrong? (the trace looks like there are no files, to work with. they are gone somehow...)
8x-------- lines pasted in from teamcity log
in directory: C:\TeamCity\BuildAgent1\work\4c50753a43ea36fe
17:14:49 Microsoft (R) Build Engine version 16.11.2+f32259642 for .NET
17:14:49 Copyright (C) Microsoft Corporation. All rights reserved.
17:14:49
17:14:50 Build started 27/01/2022 17.14.50.
17:14:50 0>Process = "C:\Program Files\dotnet\dotnet.exe"
17:14:50 MSBuild executable path = "C:\Program Files\dotnet\sdk\5.0.404\MSBuild.dll"
17:14:50 Command line arguments = ""C:\Program Files\dotnet\sdk\5.0.404\MSBuild.dll" -maxcpucount -verbosity:m -target:Publish -property:TargetFramework=net5.0 -property:Configuration=Release -property:VersionSuffix=187 -property:NoBuild=true C:\TeamCity\BuildAgent1\work\4c50753a43ea36fe\TeamCityNugetTest.sln @C:\TeamCity\BuildAgent1\temp\agentTmp\2.rsp"
17:14:50 Current directory = "C:\TeamCity\BuildAgent1\work\4c50753a43ea36fe"
17:14:50 MSBuild version = "16.11.2+f32259642"
17:14:50 Project "TeamCityNugetTest.sln": Publish
Solution 1:[1]
I would suggest you define your output directory to a location outside of:
C:\TeamCity\BuildAgent1\work\4c50753a43ea36fe
I assume TeamCity is trying to put the outputs in \bin
, as happens on a normal build/publish, unless you specify the output elsewhere. And if your repository doesn't contain \bin
, it won't have an actual place to put it when it's done.
Also, you could probably just do the second build step. I believe dotnet publish
will build the project/solution anyway.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Jeremy Caney |